mercurial/branchmap.py
changeset 51456 19b2736c8e45
parent 51455 7a063dd9d64e
child 51460 cebd96dee99a
equal deleted inserted replaced
51455:7a063dd9d64e 51456:19b2736c8e45
   436         # cache has been updated, it may contain nodes that are no longer
   436         # cache has been updated, it may contain nodes that are no longer
   437         # heads.
   437         # heads.
   438 
   438 
   439         # Do we need to verify branch at all ?
   439         # Do we need to verify branch at all ?
   440         self._verify_node = verify_node
   440         self._verify_node = verify_node
   441         # whether closed nodes are verified or not
       
   442         self._closedverified = False
       
   443         # branches for which nodes are verified
   441         # branches for which nodes are verified
   444         self._verifiedbranches = set()
   442         self._verifiedbranches = set()
   445         self._hasnode = None
   443         self._hasnode = None
   446         if self._verify_node:
   444         if self._verify_node:
   447             self._hasnode = repo.changelog.hasnode
   445             self._hasnode = repo.changelog.hasnode
   551         )
   549         )
   552         # we copy will likely schedule a write anyway, but that does not seems
   550         # we copy will likely schedule a write anyway, but that does not seems
   553         # to hurt to overschedule
   551         # to hurt to overschedule
   554         other._delayed = self._delayed
   552         other._delayed = self._delayed
   555         # also copy information about the current verification state
   553         # also copy information about the current verification state
   556         other._closedverified = self._closedverified
       
   557         other._verifiedbranches = set(self._verifiedbranches)
   554         other._verifiedbranches = set(self._verifiedbranches)
   558         return other
   555         return other
   559 
   556 
   560     def write(self, repo):
   557     def write(self, repo):
   561         assert self._filtername == repo.filtername, (
   558         assert self._filtername == repo.filtername, (
   599             repo.ui.debug(
   596             repo.ui.debug(
   600                 b"couldn't write branch cache: %s\n"
   597                 b"couldn't write branch cache: %s\n"
   601                 % stringutil.forcebytestr(inst)
   598                 % stringutil.forcebytestr(inst)
   602             )
   599             )
   603 
   600 
   604     def _verifyclosed(self):
       
   605         """verify the closed nodes we have"""
       
   606         if not self._verify_node:
       
   607             return
       
   608         if self._closedverified:
       
   609             return
       
   610         assert self._hasnode is not None
       
   611         for node in self._closednodes:
       
   612             if not self._hasnode(node):
       
   613                 _unknownnode(node)
       
   614 
       
   615         self._closedverified = True
       
   616 
       
   617     def _verifybranch(self, branch):
   601     def _verifybranch(self, branch):
   618         """verify head nodes for the given branch."""
   602         """verify head nodes for the given branch."""
   619         if not self._verify_node:
   603         if not self._verify_node:
   620             return
   604             return
   621         if branch not in self._entries or branch in self._verifiedbranches:
   605         if branch not in self._entries or branch in self._verifiedbranches: