Show More
@@ -743,21 +743,17 b' class revlog(object):' | |||
|
743 | 743 | ancs = ancestor.commonancestorsheads(self.parentrevs, a, b) |
|
744 | 744 | return map(self.node, ancs) |
|
745 | 745 | |
|
746 |
def |
|
|
747 |
"""calculate the least common ancestor |
|
|
746 | def ancestor(self, a, b): | |
|
747 | """calculate the least common ancestor of nodes a and b""" | |
|
748 | ||
|
748 | 749 | a, b = self.rev(a), self.rev(b) |
|
749 | 750 | try: |
|
750 | 751 | ancs = self.index.ancestors(a, b) |
|
751 |
except (AttributeError, OverflowError): |
|
|
752 | except (AttributeError, OverflowError): | |
|
752 | 753 | ancs = ancestor.ancestors(self.parentrevs, a, b) |
|
753 | return map(self.node, ancs) | |
|
754 | ||
|
755 | def ancestor(self, a, b): | |
|
756 | """calculate a least common ancestor of nodes a and b""" | |
|
757 | ancs = self.commonancestors(a, b) | |
|
758 | 754 | if ancs: |
|
759 | 755 | # choose a consistent winner when there's a tie |
|
760 | return min(ancs) | |
|
756 | return min(map(self.node, ancs)) | |
|
761 | 757 | return nullid |
|
762 | 758 | |
|
763 | 759 | def _match(self, id): |
General Comments 0
You need to be logged in to leave comments.
Login now