##// END OF EJS Templates
Branch heads should not include "heads" that are ancestors of other heads....
Brendan Cully -
r8954:e67e5b60 default
parent child Browse files
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 bheads.remove(pn)
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):
@@ -19,6 +19,9 b' hg branch default'
19 19 hg branch -f default
20 20 hg ci -m "clear branch name" -d "1000000 0"
21 21
22 echo % there should be only one default branch head
23 hg heads .
24
22 25 hg co foo
23 26 hg branch
24 27 echo bleah > a
General Comments 0
You need to be logged in to leave comments. Login now