mercurial/branchmap.py
changeset 52645 4cb75772818d
parent 52640 24ee91ba9aa8
child 52651 f066fc0bdc7a
equal deleted inserted replaced
52644:e627cc25b6f3 52645:4cb75772818d
   200     branch heads of a repo.
   200     branch heads of a repo.
   201     """
   201     """
   202 
   202 
   203     def __init__(
   203     def __init__(
   204         self,
   204         self,
   205         repo: "localrepo.localrepository",
   205         repo: localrepo.localrepository,
   206         entries: Union[
   206         entries: Union[
   207             Dict[bytes, List[bytes]], Iterable[Tuple[bytes, List[bytes]]]
   207             Dict[bytes, List[bytes]], Iterable[Tuple[bytes, List[bytes]]]
   208         ] = (),
   208         ] = (),
   209         closed_nodes: Optional[Set[bytes]] = None,
   209         closed_nodes: Optional[Set[bytes]] = None,
   210     ) -> None:
   210     ) -> None:
   435     _base_filename = None
   435     _base_filename = None
   436     _default_key_hashes: Tuple[bytes] = cast(Tuple[bytes], ())
   436     _default_key_hashes: Tuple[bytes] = cast(Tuple[bytes], ())
   437 
   437 
   438     def __init__(
   438     def __init__(
   439         self,
   439         self,
   440         repo: "localrepo.localrepository",
   440         repo: localrepo.localrepository,
   441         entries: Union[
   441         entries: Union[
   442             Dict[bytes, List[bytes]], Iterable[Tuple[bytes, List[bytes]]]
   442             Dict[bytes, List[bytes]], Iterable[Tuple[bytes, List[bytes]]]
   443         ] = (),
   443         ] = (),
   444         tipnode: Optional[bytes] = None,
   444         tipnode: Optional[bytes] = None,
   445         tiprev: Optional[int] = nullrev,
   445         tiprev: Optional[int] = nullrev,
   543                 f.close()
   543                 f.close()
   544 
   544 
   545         return bcache
   545         return bcache
   546 
   546 
   547     @classmethod
   547     @classmethod
   548     def _load_header(cls, repo, lineiter) -> "dict[str, Any]":
   548     def _load_header(cls, repo, lineiter) -> dict[str, Any]:
   549         raise NotImplementedError
   549         raise NotImplementedError
   550 
   550 
   551     def _load_heads(self, repo, lineiter):
   551     def _load_heads(self, repo, lineiter):
   552         """fully loads the branchcache by reading from the file using the line
   552         """fully loads the branchcache by reading from the file using the line
   553         iterator passed"""
   553         iterator passed"""
   786     """
   786     """
   787 
   787 
   788     _base_filename = b"branch2"
   788     _base_filename = b"branch2"
   789 
   789 
   790     @classmethod
   790     @classmethod
   791     def _load_header(cls, repo, lineiter) -> "dict[str, Any]":
   791     def _load_header(cls, repo, lineiter) -> dict[str, Any]:
   792         """parse the head of a branchmap file
   792         """parse the head of a branchmap file
   793 
   793 
   794         return parameters to pass to a newly created class instance.
   794         return parameters to pass to a newly created class instance.
   795         """
   795         """
   796         cachekey = next(lineiter).rstrip(b'\n').split(b" ", 2)
   796         cachekey = next(lineiter).rstrip(b'\n').split(b" ", 2)
  1077 class remotebranchcache(_BaseBranchCache):
  1077 class remotebranchcache(_BaseBranchCache):
  1078     """Branchmap info for a remote connection, should not write locally"""
  1078     """Branchmap info for a remote connection, should not write locally"""
  1079 
  1079 
  1080     def __init__(
  1080     def __init__(
  1081         self,
  1081         self,
  1082         repo: "localrepo.localrepository",
  1082         repo: localrepo.localrepository,
  1083         entries: Union[
  1083         entries: Union[
  1084             Dict[bytes, List[bytes]], Iterable[Tuple[bytes, List[bytes]]]
  1084             Dict[bytes, List[bytes]], Iterable[Tuple[bytes, List[bytes]]]
  1085         ] = (),
  1085         ] = (),
  1086         closednodes: Optional[Set[bytes]] = None,
  1086         closednodes: Optional[Set[bytes]] = None,
  1087     ) -> None:
  1087     ) -> None: