# HG changeset patch # User Pierre-Yves David # Date 2024-08-05 08:15:10 # Node ID e2f1efa2bd86755ab3a8d30b8de6662b8e86ea10 # Parent 8e1b2868770448ac460255f3faa9b19f0d18ea14 manifest: help pytype to understant `writesubtrees`'s `getnode` type Since we provide a default, the return of `_lazydirs.get` is cannot be None. We help pytype to understand that. diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -1407,7 +1407,9 @@ class TreeManifest: ld = m._lazydirs.get(d) if ld: return ld[0] - return m._dirs.get(d, emptytree)._node + tree = m._dirs.get(d, emptytree) + assert tree is not None # helps pytype + return tree._node # let's skip investigating things that `match` says we do not need. visit = match.visitchildrenset(self._dir[:-1])