comparison mercurial/localrepo.py @ 16628:3c738cb162bf

localrepo: cleanup var names and comments Cosmetic cleanups. Fix comment typo referring to the notion of multiple tips. Make variable describing a generator end in 'gen'. Fix another var containing a node not to end with 'rev'.
author redstone
date Fri, 11 May 2012 10:53:12 -0700
parents 503e674fb545
children 9a21fc2c7d32
comparison
equal deleted inserted replaced
16627:38c45a99be0b 16628:3c738cb162bf
502 else: 502 else:
503 lrev = self.changelog.rev(oldtip) 503 lrev = self.changelog.rev(oldtip)
504 partial = self._branchcache 504 partial = self._branchcache
505 505
506 self._branchtags(partial, lrev) 506 self._branchtags(partial, lrev)
507 # this private cache holds all heads (not just tips) 507 # this private cache holds all heads (not just the branch tips)
508 self._branchcache = partial 508 self._branchcache = partial
509 509
510 def branchmap(self): 510 def branchmap(self):
511 '''returns a dictionary {branch: [branchheads]}''' 511 '''returns a dictionary {branch: [branchheads]}'''
512 self.updatebranchcache() 512 self.updatebranchcache()
582 # starting from tip means fewer passes over reachable 582 # starting from tip means fewer passes over reachable
583 while newnodes: 583 while newnodes:
584 latest = newnodes.pop() 584 latest = newnodes.pop()
585 if latest not in bheads: 585 if latest not in bheads:
586 continue 586 continue
587 minbhrev = self[bheads[0]].node() 587 minbhnode = self[bheads[0]].node()
588 reachable = self.changelog.reachable(latest, minbhrev) 588 reachable = self.changelog.reachable(latest, minbhnode)
589 reachable.remove(latest) 589 reachable.remove(latest)
590 if reachable: 590 if reachable:
591 bheads = [b for b in bheads if b not in reachable] 591 bheads = [b for b in bheads if b not in reachable]
592 partial[branch] = bheads 592 partial[branch] = bheads
593 593
1691 # 1691 #
1692 # We can pick: 1692 # We can pick:
1693 # * missingheads part of comon (::commonheads) 1693 # * missingheads part of comon (::commonheads)
1694 common = set(outgoing.common) 1694 common = set(outgoing.common)
1695 cheads = [node for node in revs if node in common] 1695 cheads = [node for node in revs if node in common]
1696 # and 1696 # and
1697 # * commonheads parents on missing 1697 # * commonheads parents on missing
1698 revset = self.set('%ln and parents(roots(%ln))', 1698 revset = self.set('%ln and parents(roots(%ln))',
1699 outgoing.commonheads, 1699 outgoing.commonheads,
1700 outgoing.missing) 1700 outgoing.missing)
1701 cheads.extend(c.node() for c in revset) 1701 cheads.extend(c.node() for c in revset)