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