Summary:
Previously 'arc diff X' with mercurial meant to use X as the base
to diff against. Now it means use gca(X,working directory) as the base to
diff against. This matches the git behavior.
Test Plan:
Ran 'arc diff master' on a repo where master was ahead of the feature branch.
Verified that the diff result included only the diffs in the feature branch.
Reviewers: epriestley, sid0, bos, dschleimer
Reviewed By: epriestley
CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4865
protected function buildBaseCommit($symbolic_commit) {
if ($symbolic_commit !== null) {
try {
- $commit = $this->getCanonicalRevisionName($symbolic_commit);
+ $commit = $this->getCanonicalRevisionName(
+ hgsprintf('ancestor(%s,.)', $symbolic_commit));
} catch (Exception $ex) {
throw new ArcanistUsageException(
"Commit '{$commit}' is not a valid Mercurial commit identifier.");
}
- $this->setBaseCommitExplanation("you specified it explicitly.");
+
+ $this->setBaseCommitExplanation("it is the greatest common ancestor of ".
+ "the working directory and the commit you specified explicitly.");
return $commit;
}
Supports: git, svn, hg
Generate a Differential diff or revision from local changes.
- Under git, you can specify a commit (like __HEAD^^^__ or __master__)
- and Differential will generate a diff against the merge base of that
- commit and HEAD.
+ Under git and mercurial, you can specify a commit (like __HEAD^^^__
+ or __master__) and Differential will generate a diff against the
+ merge base of that commit and your current working directory parent.
Under svn, you can choose to include only some of the modified files
in the working copy in the diff by specifying their paths. If you