mercurial/branchmap.py
changeset 44452 9d2b2df2c2ba
parent 44306 a0ec05d93c8e
child 45942 89a2afe31e82
equal deleted inserted replaced
44449:ff72bd52d56a 44452:9d2b2df2c2ba
   444         # if older branchheads are reachable from new ones, they aren't
   444         # if older branchheads are reachable from new ones, they aren't
   445         # really branchheads. Note checking parents is insufficient:
   445         # really branchheads. Note checking parents is insufficient:
   446         # 1 (branch a) -> 2 (branch b) -> 3 (branch a)
   446         # 1 (branch a) -> 2 (branch b) -> 3 (branch a)
   447         for branch, newheadrevs in pycompat.iteritems(newbranches):
   447         for branch, newheadrevs in pycompat.iteritems(newbranches):
   448             bheads = self._entries.setdefault(branch, [])
   448             bheads = self._entries.setdefault(branch, [])
   449             bheadset = set(cl.rev(node) for node in bheads)
   449             bheadset = {cl.rev(node) for node in bheads}
   450 
   450 
   451             # This have been tested True on all internal usage of this function.
   451             # This have been tested True on all internal usage of this function.
   452             # run it again in case of doubt
   452             # run it again in case of doubt
   453             # assert not (set(bheadrevs) & set(newheadrevs))
   453             # assert not (set(bheadrevs) & set(newheadrevs))
   454             bheadset.update(newheadrevs)
   454             bheadset.update(newheadrevs)
   580         self._rbcrevs = bytearray(self._rbcrevslen * _rbcrecsize)
   580         self._rbcrevs = bytearray(self._rbcrevslen * _rbcrecsize)
   581         util.clearcachedproperty(self, b'_namesreverse')
   581         util.clearcachedproperty(self, b'_namesreverse')
   582 
   582 
   583     @util.propertycache
   583     @util.propertycache
   584     def _namesreverse(self):
   584     def _namesreverse(self):
   585         return dict((b, r) for r, b in enumerate(self._names))
   585         return {b: r for r, b in enumerate(self._names)}
   586 
   586 
   587     def branchinfo(self, rev):
   587     def branchinfo(self, rev):
   588         """Return branch name and close flag for rev, using and updating
   588         """Return branch name and close flag for rev, using and updating
   589         persistent cache."""
   589         persistent cache."""
   590         changelog = self._repo.changelog
   590         changelog = self._repo.changelog