mercurial/context.py
changeset 52723 a502f3f389b5
parent 52721 f071b18e1382
child 52769 b3349f6cded9
--- a/mercurial/context.py	Sat Feb 01 13:47:56 2025 +0100
+++ b/mercurial/context.py	Sun Feb 02 00:20:11 2025 +0100
@@ -2542,17 +2542,18 @@
         files = self.files()
 
         def getfile(repo, memctx, path):
-            if path not in self._cache:
+            hit = self._cache.get(path)
+            if hit is None:
                 return self.filectx(path)
-            elif self._cache[path][b'exists']:
+            elif hit[b'exists']:
                 return memfilectx(
                     repo,
                     memctx,
                     path,
-                    self._cache[path][b'data'],
-                    b'l' in self._cache[path][b'flags'],
-                    b'x' in self._cache[path][b'flags'],
-                    self._cache[path][b'copied'],
+                    hit[b'data'],
+                    b'l' in hit[b'flags'],
+                    b'x' in hit[b'flags'],
+                    hit[b'copied'],
                 )
             else:
                 # Returning None, but including the path in `files`, is