mercurial/revset.py
changeset 38625 52f19a840543
parent 38624 5460926352ee
child 38704 607e2a2501e6
--- a/mercurial/revset.py	Mon Jun 18 19:41:54 2018 -0700
+++ b/mercurial/revset.py	Tue Jun 26 15:26:21 2018 -0700
@@ -608,6 +608,19 @@
     return subset.filter(lambda r: repo[r].closesbranch(),
                          condrepr='<branch closed>')
 
+# for internal use
+@predicate('_commonancestorheads(set)', safe=True)
+def _commonancestorheads(repo, subset, x):
+    # 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
+    # merge will find.
+    h = heads(repo, fullreposet(repo), x, defineorder)
+
+    ancs = repo.changelog._commonancestorsheads(*list(h))
+    return subset & baseset(ancs)
+
 @predicate('commonancestors(set)', safe=True)
 def commonancestors(repo, subset, x):
     """Returns all common ancestors of the set.