D6236: branchcache: lazily validate nodes in iteritems()

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Mon Apr 15 12:26:50 EDT 2019


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This saves ~0.30 sec on creating a new branch on our internal repo.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/branchmap.py

CHANGE DETAILS

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -218,8 +218,9 @@
         return key in self._entries
 
     def iteritems(self):
-        self._verifyall()
-        return self._entries.iteritems()
+        for k, v in self._entries.iteritems():
+            self._verifybranch(k)
+            yield k, v
 
     def hasbranch(self, label):
         """ checks whether a branch of this name exists or not """



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


More information about the Mercurial-devel mailing list