D4742: revset: make heads(commonancestors(x + x^)) be x^, not x

valentin.gatienbaron (Valentin Gatien-Baron) phabricator at mercurial-scm.org
Tue Sep 25 21:19:30 UTC 2018


valentin.gatienbaron created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4742

AFFECTED FILES
  mercurial/revset.py
  tests/test-revset.t

CHANGE DETAILS

diff --git a/tests/test-revset.t b/tests/test-revset.t
--- a/tests/test-revset.t
+++ b/tests/test-revset.t
@@ -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
 
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -616,11 +616,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)
 
-    ancs = repo.changelog._commonancestorsheads(*list(h))
+    ancs = repo.changelog._commonancestorsheads(*list(startrevs))
     return subset & baseset(ancs)
 
 @predicate('commonancestors(set)', safe=True)



To: valentin.gatienbaron, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list