Patchwork D9731: narrow: overwrite readfast in excludeddirmanifestctx

login
register
mail settings
Submitter phabricator
Date Jan. 12, 2021, 10:40 p.m.
Message ID <differential-rev-PHID-DREV-aa45y6hdntnkcdevqpry-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48043/
State Superseded
Headers show

Comments

phabricator - Jan. 12, 2021, 10:40 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9731

AFFECTED FILES
  mercurial/manifest.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -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