revset: make heads(commonancestors(x + x^)) be x^, not x stable
authorValentin Gatien-Baron <vgatien-baron@janestreet.com>
Tue, 25 Sep 2018 16:32:38 -0400
branchstable
changeset 39805 823f34acfd46
parent 39804 84c61c1593c4
child 39806 0ad5f064d829
child 39832 85a474adaf26
revset: make heads(commonancestors(x + x^)) be x^, not x Differential Revision: https://phab.mercurial-scm.org/D4742
mercurial/revset.py
tests/test-revset.t
--- a/mercurial/revset.py	Tue Sep 25 16:29:39 2018 -0400
+++ b/mercurial/revset.py	Tue Sep 25 16:32:38 2018 -0400
@@ -614,11 +614,11 @@
     # This is an internal method is for quickly calculating "heads(::x and
     # ::y)"
 
-    # These greatest common ancestors are the same ones that the consesus bid
+    # These greatest common ancestors are the same ones that the consensus bid
     # merge will find.
-    h = heads(repo, fullreposet(repo), x, anyorder)
+    startrevs = getset(repo, fullreposet(repo), x, order=anyorder)
 
-    ancs = repo.changelog._commonancestorsheads(*list(h))
+    ancs = repo.changelog._commonancestorsheads(*list(startrevs))
     return subset & baseset(ancs)
 
 @predicate('commonancestors(set)', safe=True)
--- a/tests/test-revset.t	Tue Sep 25 16:29:39 2018 -0400
+++ b/tests/test-revset.t	Tue Sep 25 16:32:38 2018 -0400
@@ -1080,7 +1080,7 @@
   $ hg log -T '{rev}\n' -r 'heads(commonancestors(9))'
   9
   $ hg log -T '{rev}\n' -r 'heads(commonancestors(8 + 9))'
-  9
+  8
 
 test ancestor variants of empty revision