Show More
@@ -454,15 +454,30 b' class localrepository(repo.repository):' | |||
|
454 | 454 | pass |
|
455 | 455 | |
|
456 | 456 | def _updatebranchcache(self, partial, start, end): |
|
457 | # collect new branch entries | |
|
458 | newbranches = {} | |
|
457 | 459 | for r in xrange(start, end): |
|
458 | 460 | c = self[r] |
|
459 | b = c.branch() | |
|
460 | bheads = partial.setdefault(b, []) | |
|
461 | bheads.append(c.node()) | |
|
462 | for p in c.parents(): | |
|
463 | pn = p.node() | |
|
464 | if pn in bheads: | |
|
465 |
|
|
|
461 | newbranches.setdefault(c.branch(), []).append(c.node()) | |
|
462 | # if older branchheads are reachable from new ones, they aren't | |
|
463 | # really branchheads. Note checking parents is insufficient: | |
|
464 | # 1 (branch a) -> 2 (branch b) -> 3 (branch a) | |
|
465 | for branch, newnodes in newbranches.iteritems(): | |
|
466 | bheads = partial.setdefault(branch, []) | |
|
467 | bheads.extend(newnodes) | |
|
468 | if len(bheads) < 2: | |
|
469 | continue | |
|
470 | newbheads = [] | |
|
471 | # starting from tip means fewer passes over reachable | |
|
472 | while newnodes: | |
|
473 | latest = newnodes.pop() | |
|
474 | if latest not in bheads: | |
|
475 | continue | |
|
476 | reachable = self.changelog.reachable(latest, bheads[0]) | |
|
477 | bheads = [b for b in bheads if b not in reachable] | |
|
478 | newbheads.insert(0, latest) | |
|
479 | bheads.extend(newbheads) | |
|
480 | partial[branch] = bheads | |
|
466 | 481 | |
|
467 | 482 | def lookup(self, key): |
|
468 | 483 | if isinstance(key, int): |
General Comments 0
You need to be logged in to leave comments.
Login now