changeset 21107:4a6c8b6b10d3

revlog: backout 514d32de6646 - commonancestors
author Mads Kiilerich <madski@unity3d.com>
date Thu, 17 Apr 2014 20:01:39 +0200
parents 53433d8f1faa
children e5ad36a845af
files mercurial/revlog.py
diffstat 1 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Thu Apr 17 20:01:39 2014 +0200
+++ b/mercurial/revlog.py	Thu Apr 17 20:01:39 2014 +0200
@@ -743,21 +743,17 @@
             ancs = ancestor.commonancestorsheads(self.parentrevs, a, b)
         return map(self.node, ancs)
 
-    def commonancestors(self, a, b):
-        """calculate the least common ancestors of nodes a and b"""
+    def ancestor(self, a, b):
+        """calculate the least common ancestor of nodes a and b"""
+
         a, b = self.rev(a), self.rev(b)
         try:
             ancs = self.index.ancestors(a, b)
-        except (AttributeError, OverflowError): # C implementation failed
+        except (AttributeError, OverflowError):
             ancs = ancestor.ancestors(self.parentrevs, a, b)
-        return map(self.node, ancs)
-
-    def ancestor(self, a, b):
-        """calculate a least common ancestor of nodes a and b"""
-        ancs = self.commonancestors(a, b)
         if ancs:
             # choose a consistent winner when there's a tie
-            return min(ancs)
+            return min(map(self.node, ancs))
         return nullid
 
     def _match(self, id):