Mercurial > public > mercurial-scm > hg
comparison mercurial/manifest.py @ 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 | 14e500b58263 |
children | 19103e68a698 |
comparison
equal
deleted
inserted
replaced
39980:d71e0ba34d9b | 39981:da0319e024c0 |
---|---|
704 for k, (path, node, readsubtree) in self._lazydirs.iteritems(): | 704 for k, (path, node, readsubtree) in self._lazydirs.iteritems(): |
705 self._dirs[k] = readsubtree(path, node) | 705 self._dirs[k] = readsubtree(path, node) |
706 self._lazydirs = {} | 706 self._lazydirs = {} |
707 | 707 |
708 def _loadlazy(self, d): | 708 def _loadlazy(self, d): |
709 path, node, readsubtree = self._lazydirs[d] | 709 v = self._lazydirs.get(d) |
710 self._dirs[d] = readsubtree(path, node) | 710 if v: |
711 del self._lazydirs[d] | 711 path, node, readsubtree = v |
712 self._dirs[d] = readsubtree(path, node) | |
713 del self._lazydirs[d] | |
712 | 714 |
713 def _loadchildrensetlazy(self, visit): | 715 def _loadchildrensetlazy(self, visit): |
714 if not visit: | 716 if not visit: |
715 return None | 717 return None |
716 if visit == 'all' or visit == 'this': | 718 if visit == 'all' or visit == 'this': |