comparison mercurial/branchmap.py @ 51521:19b2736c8e45

branchcache: drop the unused `_verifyclosed` This code appears dead since its introduction about 5 years ago in this three consecutive commits: - 6578654916ae ? introduce the method with two calls - 7c9d4cf23adf ? remove first call - be5eeaf5c24a ? remove second call o changeset: be5eeaf5c24a | user: Pulkit Goyal <pulkit@yandex-team.ru> | date: Fri Apr 05 15:57:09 2019 +0300 | summary: branchcache: don't verify closed nodes in _branchtip() | o changeset: 7c9d4cf23adf | user: Pulkit Goyal <pulkit@yandex-team.ru> | date: Fri Apr 05 15:56:33 2019 +0300 | summary: branchcache: don't verify closed nodes in iteropen() | o changeset: 6578654916ae | user: Pulkit Goyal <pulkit@yandex-team.ru> ~ date: Mon Apr 01 13:56:47 2019 +0300 summary: branchcache: lazily validate nodes from the branchmap
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 25 Feb 2024 16:14:15 +0100
parents 7a063dd9d64e
children cebd96dee99a
comparison
equal deleted inserted replaced
51520:7a063dd9d64e 51521: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: