Patchwork [1,of,2,V2] revset: clarify heads() order doesn't matter while computing common ancestors

login
register
mail settings
Submitter Yuya Nishihara
Date July 16, 2018, 10:48 a.m.
Message ID <ca00702fa0d3619554b2.1531738131@mimosa>
Download mbox | patch
Permalink /patch/32858/
State Accepted
Headers show

Comments

Yuya Nishihara - July 16, 2018, 10:48 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1531231313 -32400
#      Tue Jul 10 23:01:53 2018 +0900
# Node ID ca00702fa0d3619554b2d17fb321fd107186c7b3
# Parent  3c569172848d329a81b1420d7cd8a5549b48f25f
revset: clarify heads() order doesn't matter while computing common ancestors

Follows up 5460926352ee and 52f19a840543.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -616,7 +616,7 @@  def _commonancestorheads(repo, subset, x
 
     # These greatest common ancestors are the same ones that the consesus bid
     # merge will find.
-    h = heads(repo, fullreposet(repo), x, defineorder)
+    h = heads(repo, fullreposet(repo), x, anyorder)
 
     ancs = repo.changelog._commonancestorsheads(*list(h))
     return subset & baseset(ancs)
@@ -632,7 +632,7 @@  def commonancestors(repo, subset, x):
 
     """
     # only wants the heads of the set passed in
-    for r in heads(repo, fullreposet(repo), x, defineorder):
+    for r in heads(repo, fullreposet(repo), x, anyorder):
         subset &= dagop.revancestors(repo, baseset([r]))
 
     return subset