This is an archive of the discontinued Mercurial Phabricator instance.

branchcache: don't verify while creating a copy
ClosedPublic

Authored by pulkit on Apr 16 2019, 8:26 AM.

Details

Summary

The copy will not be mark as verified, so there is no need to verify nodes.
Thanks to Yuya who spotted this while reviewing.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

pulkit created this revision.Apr 16 2019, 8:26 AM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Apr 16 2019, 7:08 PM
def copy(self):
    """return an deep copy of the branchcache object"""
  • self._verifyall() return type(self)( self._entries, self.tipnode, self.tiprev, self.filteredhash, self._closednodes)

Looks good, but it's probably better to copy the verification state to
new instance, or simply make branchcache() start with "verified" state.
IIUC, only branches loaded from file have to be validated.