merge: show the scary multiple ancestor hint for merges only, not for updates
Updates with uncommited changes will always only have one ancestor - the parent
revision. Updates between existing revision should (and will) always give the
same result no matter which ancestor is used. The warning is thus only relevant
when doing a "real" merge.
--- a/mercurial/merge.py Thu Aug 14 16:26:41 2014 -0700
+++ b/mercurial/merge.py Fri Aug 15 02:39:01 2014 +0200
@@ -1052,7 +1052,7 @@
cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node())
pas = [repo[anc] for anc in (sorted(cahs) or [nullid])]
else:
- pas = [p1.ancestor(p2, warn=True)]
+ pas = [p1.ancestor(p2, warn=branchmerge)]
fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
--- a/tests/test-merge-criss-cross.t Thu Aug 14 16:26:41 2014 -0700
+++ b/tests/test-merge-criss-cross.t Fri Aug 15 02:39:01 2014 +0200
@@ -24,8 +24,6 @@
$ hg ci -m '5 second change f1'
$ hg up -r3
- note: using 0f6b37dbe527 as ancestor of adfe50279922 and cf89f02107e5
- alternatively, use --config merge.preferancestor=40663881a6dd
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo '6 second change' > f2
$ hg ci -m '6 second change f2'
@@ -169,8 +167,6 @@
The other way around:
$ hg up -C -r5
- note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
- alternatively, use --config merge.preferancestor=40663881a6dd
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg merge -v --debug --config merge.preferancestor="*"
note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd