Mercurial > hg
changeset 39981:da0319e024c0
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
author | spectral <spectral@google.com> |
---|---|
date | Tue, 02 Oct 2018 13:37:12 -0700 |
parents | d71e0ba34d9b |
children | 19103e68a698 |
files | mercurial/manifest.py |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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: