Patchwork D6240: branchcache: only iterate over branches which needs to be verified

login
register
mail settings
Submitter phabricator
Date April 16, 2019, 12:27 p.m.
Message ID <differential-rev-PHID-DREV-tso7mpwklwl6ptabpbnv-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39628/
State Superseded
Headers show

Comments

phabricator - April 16, 2019, 12:27 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Otherwise we loop over all the branches and call _verifybranch() even if not
  required.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/branchmap.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -200,7 +200,8 @@ 
 
     def _verifyall(self):
         """ verifies nodes of all the branches """
-        for b in self._entries:
+        needverification = set(self._entries.keys()) - self._verifiedbranches
+        for b in needverification:
             self._verifybranch(b)
 
     def __iter__(self):