D6207: branchcache: add functions to validate changelog nodes

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Mon Apr 15 19:16:45 EDT 2019


yuja added a comment.


  Queued, thanks.
  
  > +    def _verifybranch(self, branch):
  >  +        """ verify head nodes for the given branch. If branch is None, verify
  >  +        for all the branches """
  
  "If branch is None, ..." appears wrong.
  
  > +        if branch not in self._entries or branch in self._verifiedbranches:
  >  +            return
  >  +        for n in self._entries[branch]:
  >  +            if not self._hasnode(n):
  >  +                _unknownnode(n)
  >  +
  >  +        self._verifiedbranches.add(branch)
  
  Regarding https://phab.mercurial-scm.org/D6236, `_verifiedbranches` could be inverted (i.e. a set of branches
  to be verified) so that `_verifyall()` can return early. I don't know which
  will be faster, but in principle, fewer loops and Python gives a better result.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6207

To: pulkit, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list