mercurial/revlog.py
changeset 18988 5bae936764bb
parent 18987 3605d4e7e618
child 18989 12a3474c1634
--- a/mercurial/revlog.py	Tue Apr 16 10:08:19 2013 -0700
+++ b/mercurial/revlog.py	Tue Apr 16 10:08:20 2013 -0700
@@ -706,7 +706,13 @@
         """calculate the least common ancestor of nodes a and b"""
 
         a, b = self.rev(a), self.rev(b)
-        ancs = ancestor.ancestors(self.parentrevs, a, b)
+        try:
+            ancs = self.index.ancestors(a, b)
+            old = ancestor.ancestors(self.parentrevs, a, b)
+            assert set(ancs) == old, ('opinions differ over ancestor(%d, %d)' %
+                                      (a, b))
+        except (AttributeError, OverflowError):
+            ancs = ancestor.ancestors(self.parentrevs, a, b)
         if ancs:
             # choose a consistent winner when there's a tie
             return min(map(self.node, ancs))