treemanifests: make _loadlazy tolerate item not on _lazydirs
I'd like to clean up a few cases where we check for an item in _lazydirs before
calling _loadlazy - this will remove an extraneous dict lookup and make it
slightly more versatile.
Differential Revision: https://phab.mercurial-scm.org/D4842
--- a/mercurial/manifest.py Wed Aug 08 23:17:16 2018 -0700
+++ b/mercurial/manifest.py Tue Oct 02 13:37:12 2018 -0700
@@ -706,9 +706,11 @@
self._lazydirs = {}
def _loadlazy(self, d):
- path, node, readsubtree = self._lazydirs[d]
- self._dirs[d] = readsubtree(path, node)
- del self._lazydirs[d]
+ v = self._lazydirs.get(d)
+ if v:
+ path, node, readsubtree = v
+ self._dirs[d] = readsubtree(path, node)
+ del self._lazydirs[d]
def _loadchildrensetlazy(self, visit):
if not visit: