Comments
Patch
@@ -2491,7 +2491,17 @@
# maybe the index.append should compute it when applicable instead
rank = RANK_UNKNOWN
if self._format_version == CHANGELOGV2:
- rank = len(list(self.ancestors([p1r, p2r], inclusive=True))) + 1
+ if (p1r, p2r) == (nullrev, nullrev):
+ rank = 1
+ elif p1r != nullrev and p2r == nullrev:
+ rank = 1 + self.fast_rank(p1r)
+ elif p1r == nullrev and p2r != nullrev:
+ rank = 1 + self.fast_rank(p2r)
+ else: # merge node
+ # TODO: use exclusive part size from leap info when those will
+ # be available
+ rank = (1 +
+ sum(1 for _ in self.ancestors([p1r, p2r], inclusive=True)))
e = revlogutils.entry(
flags=flags,