narrow: overwrite readfast in excludeddirmanifestctx
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 12 Jan 2021 23:27:24 +0100
changeset 46247 a3ccbac659d8
parent 46246 416ecdaa12df
child 46248 7488067b8c1e
narrow: overwrite readfast in excludeddirmanifestctx The excludeddirmanifestctx does not have underlying storage (because it is excluded) so the implementation of the `readfast` trying to access it crash. This was reveled while running some cache warning code on narrow repositories. That code will be introduced further down in the series. Differential Revision: https://phab.mercurial-scm.org/D9731
mercurial/manifest.py
--- a/mercurial/manifest.py	Mon Jan 11 17:46:55 2021 -0800
+++ b/mercurial/manifest.py	Tue Jan 12 23:27:24 2021 +0100
@@ -2297,6 +2297,10 @@
     def read(self):
         return excludeddir(self._dir, self._node)
 
+    def readfast(self, shallow=False):
+        # special version of readfast since we don't have underlying storage
+        return self.read()
+
     def write(self, *args):
         raise error.ProgrammingError(
             b'attempt to write manifest from excluded dir %s' % self._dir