Show More
@@ -1137,21 +1137,21 b' class revlog(object):' | |||
|
1137 | 1137 | self._cache = (node, curr, text) |
|
1138 | 1138 | return node |
|
1139 | 1139 | |
|
1140 |
def descendant(self, a, |
|
|
1141 | if a > b: | |
|
1142 | return False | |
|
1143 | for i in self.descendants(a): | |
|
1144 | if i == b: | |
|
1140 | def descendant(self, start, end): | |
|
1141 | for i in self.descendants(start): | |
|
1142 | if i == end: | |
|
1145 | 1143 | return True |
|
1146 |
elif i > |
|
|
1144 | elif i > end: | |
|
1147 | 1145 | break |
|
1148 | 1146 | return False |
|
1149 | 1147 | |
|
1150 | 1148 | def ancestor(self, a, b): |
|
1151 | 1149 | """calculate the least common ancestor of nodes a and b""" |
|
1152 | 1150 | |
|
1151 | # fast path, check if it is a descendant | |
|
1152 | a, b = self.rev(a), self.rev(b) | |
|
1153 | 1153 | start, end = sorted((a, b)) |
|
1154 |
if self.descendant(a, |
|
|
1154 | if self.descendant(start, end): | |
|
1155 | 1155 | return self.node(start) |
|
1156 | 1156 | |
|
1157 | 1157 | def parents(rev): |
General Comments 0
You need to be logged in to leave comments.
Login now