mercurial/branchmap.py
changeset 51457 cebd96dee99a
parent 51453 19b2736c8e45
child 51458 47752632b4fc
equal deleted inserted replaced
51456:077d5a784c58 51457:cebd96dee99a
   404 
   404 
   405 
   405 
   406 class branchcache(_BaseBranchCache):
   406 class branchcache(_BaseBranchCache):
   407     """Branchmap info for a local repo or repoview"""
   407     """Branchmap info for a local repo or repoview"""
   408 
   408 
       
   409     _base_filename = b"branch2"
       
   410 
   409     def __init__(
   411     def __init__(
   410         self,
   412         self,
   411         repo: "localrepo.localrepository",
   413         repo: "localrepo.localrepository",
   412         entries: Union[
   414         entries: Union[
   413             Dict[bytes, List[bytes]], Iterable[Tuple[bytes, List[bytes]]]
   415             Dict[bytes, List[bytes]], Iterable[Tuple[bytes, List[bytes]]]
   523             node = bin(node)
   525             node = bin(node)
   524             self._entries.setdefault(label, []).append(node)
   526             self._entries.setdefault(label, []).append(node)
   525             if state == b'c':
   527             if state == b'c':
   526                 self._closednodes.add(node)
   528                 self._closednodes.add(node)
   527 
   529 
   528     @staticmethod
   530     @classmethod
   529     def _filename(repo):
   531     def _filename(cls, repo):
   530         """name of a branchcache file for a given repo or repoview"""
   532         """name of a branchcache file for a given repo or repoview"""
   531         filename = b"branch2"
   533         filename = cls._base_filename
   532         if repo.filtername:
   534         if repo.filtername:
   533             filename = b'%s-%s' % (filename, repo.filtername)
   535             filename = b'%s-%s' % (filename, repo.filtername)
   534         return filename
   536         return filename
   535 
   537 
   536     def copy(self, repo):
   538     def copy(self, repo):