manifest: clear `_lazydirs` in place in `_loadalllazy`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 05 Aug 2024 10:11:51 +0200
changeset 51770 3be39e36732a
parent 51769 897972398e61
child 51771 1c28d9fdcd08
manifest: clear `_lazydirs` in place in `_loadalllazy` This avoid resetting the type of the dictionary in pytype eyes. This is consistent with the way the dictionary is cleared bits by bits in `_loadalllazy` Having more accurate code will help pytype. We do it in advance to help bisecting and avoid drowning them in the future type annotation noise.
mercurial/manifest.py
--- a/mercurial/manifest.py	Mon Aug 05 10:10:03 2024 +0200
+++ b/mercurial/manifest.py	Mon Aug 05 10:11:51 2024 +0200
@@ -838,7 +838,7 @@
                 selfdirs[d] = readsubtree(subpath(d), node).copy()
             else:
                 selfdirs[d] = readsubtree(subpath(d), node)
-        self._lazydirs = {}
+        self._lazydirs.clear()
 
     def _loadlazy(self, d):
         v = self._lazydirs.get(d)