--- 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))