Show More
@@ -734,17 +734,21 b' class revlog(object):' | |||
|
734 | 734 | break |
|
735 | 735 | return False |
|
736 | 736 | |
|
737 | def ancestor(self, a, b): | |
|
738 | """calculate the least common ancestor of nodes a and b""" | |
|
739 | ||
|
737 | def commonancestors(self, a, b): | |
|
738 | """calculate the least common ancestors of nodes a and b""" | |
|
740 | 739 | a, b = self.rev(a), self.rev(b) |
|
741 | 740 | try: |
|
742 | 741 | ancs = self.index.ancestors(a, b) |
|
743 | except (AttributeError, OverflowError): | |
|
742 | except (AttributeError, OverflowError): # C implementation failed | |
|
744 | 743 | ancs = ancestor.ancestors(self.parentrevs, a, b) |
|
744 | return map(self.node, ancs) | |
|
745 | ||
|
746 | def ancestor(self, a, b): | |
|
747 | """calculate a least common ancestor of nodes a and b""" | |
|
748 | ancs = self.commonancestors(a, b) | |
|
745 | 749 | if ancs: |
|
746 | 750 | # choose a consistent winner when there's a tie |
|
747 |
return min( |
|
|
751 | return min(ancs) | |
|
748 | 752 | return nullid |
|
749 | 753 | |
|
750 | 754 | def _match(self, id): |
General Comments 0
You need to be logged in to leave comments.
Login now