branchcache: lazily validate nodes in iteritems()
authorPulkit Goyal <pulkit@yandex-team.ru>
Mon, 15 Apr 2019 19:21:41 +0300
changeset 42134 f0203c3406e7
parent 42133 75e8e16ca107
child 42135 b970fece153d
branchcache: lazily validate nodes in iteritems() This saves ~0.30 sec on creating a new branch on our internal repo. Differential Revision: https://phab.mercurial-scm.org/D6236
mercurial/branchmap.py
--- a/mercurial/branchmap.py	Tue Apr 16 15:01:33 2019 +0300
+++ b/mercurial/branchmap.py	Mon Apr 15 19:21:41 2019 +0300
@@ -219,8 +219,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 """