# HG changeset patch # User spectral # Date 2018-10-02 20:37:12 # Node ID da0319e024c09de28089baf82acaa59b03f8a939 # Parent d71e0ba34d9bba52ca6956fbefe46bdfbb8d4284 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 diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -706,9 +706,11 @@ class treemanifest(object): 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: