changeset 51825:e2f1efa2bd86

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 05 Aug 2024 10:15:10 +0200
parents 8e1b28687704
children 79e0ee356f32
files mercurial/manifest.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Mon Aug 05 10:13:31 2024 +0200
+++ b/mercurial/manifest.py	Mon Aug 05 10:15:10 2024 +0200
@@ -1407,7 +1407,9 @@
             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])