mercurial/branchmap.py
changeset 48913 f254fc73d956
parent 48875 6000f5b25c9b
child 48935 2cce2fa5bcf7
equal deleted inserted replaced
48912:a0674e916fb6 48913:f254fc73d956
   268     def __contains__(self, key):
   268     def __contains__(self, key):
   269         self._verifybranch(key)
   269         self._verifybranch(key)
   270         return key in self._entries
   270         return key in self._entries
   271 
   271 
   272     def iteritems(self):
   272     def iteritems(self):
   273         for k, v in pycompat.iteritems(self._entries):
   273         for k, v in self._entries.items():
   274             self._verifybranch(k)
   274             self._verifybranch(k)
   275             yield k, v
   275             yield k, v
   276 
   276 
   277     items = iteritems
   277     items = iteritems
   278 
   278 
   398         if not closed:
   398         if not closed:
   399             heads = list(self.iteropen(heads))
   399             heads = list(self.iteropen(heads))
   400         return heads
   400         return heads
   401 
   401 
   402     def iterbranches(self):
   402     def iterbranches(self):
   403         for bn, heads in pycompat.iteritems(self):
   403         for bn, heads in self.items():
   404             yield (bn, heads) + self._branchtip(heads)
   404             yield (bn, heads) + self._branchtip(heads)
   405 
   405 
   406     def iterheads(self):
   406     def iterheads(self):
   407         """returns all the heads"""
   407         """returns all the heads"""
   408         self._verifyall()
   408         self._verifyall()
   432             cachekey = [hex(self.tipnode), b'%d' % self.tiprev]
   432             cachekey = [hex(self.tipnode), b'%d' % self.tiprev]
   433             if self.filteredhash is not None:
   433             if self.filteredhash is not None:
   434                 cachekey.append(hex(self.filteredhash))
   434                 cachekey.append(hex(self.filteredhash))
   435             f.write(b" ".join(cachekey) + b'\n')
   435             f.write(b" ".join(cachekey) + b'\n')
   436             nodecount = 0
   436             nodecount = 0
   437             for label, nodes in sorted(pycompat.iteritems(self._entries)):
   437             for label, nodes in sorted(self._entries.items()):
   438                 label = encoding.fromlocal(label)
   438                 label = encoding.fromlocal(label)
   439                 for node in nodes:
   439                 for node in nodes:
   440                     nodecount += 1
   440                     nodecount += 1
   441                     if node in self._closednodes:
   441                     if node in self._closednodes:
   442                         state = b'c'
   442                         state = b'c'
   488         parentrevs = repo.unfiltered().changelog.parentrevs
   488         parentrevs = repo.unfiltered().changelog.parentrevs
   489 
   489 
   490         # Faster than using ctx.obsolete()
   490         # Faster than using ctx.obsolete()
   491         obsrevs = obsolete.getrevs(repo, b'obsolete')
   491         obsrevs = obsolete.getrevs(repo, b'obsolete')
   492 
   492 
   493         for branch, newheadrevs in pycompat.iteritems(newbranches):
   493         for branch, newheadrevs in newbranches.items():
   494             # For every branch, compute the new branchheads.
   494             # For every branch, compute the new branchheads.
   495             # A branchhead is a revision such that no descendant is on
   495             # A branchhead is a revision such that no descendant is on
   496             # the same branch.
   496             # the same branch.
   497             #
   497             #
   498             # The branchheads are computed iteratively in revision order.
   498             # The branchheads are computed iteratively in revision order.