changeset 50502:fd5507619d16

store: only inclure revlog related file in `datafiles` This is a "reading" equivalent of the previous patches (see that patch for details).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 15 May 2023 08:55:34 +0200
parents 0dbab42adca5
children 53af67c70af0
files mercurial/store.py
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/store.py	Mon May 15 08:55:19 2023 +0200
+++ b/mercurial/store.py	Mon May 15 08:55:34 2023 +0200
@@ -510,7 +510,8 @@
         to it instead. This is very rarely needed."""
         files = self._walk(b'data', True) + self._walk(b'meta', True)
         for (t, u, s) in files:
-            yield (FILEFLAGS_FILELOG | t, u, s)
+            if t is not None:
+                yield (FILEFLAGS_FILELOG | t, u, s)
 
     def topfiles(self):
         # yield manifest before changelog
@@ -790,10 +791,15 @@
             if not _matchtrackedpath(f, matcher):
                 continue
             ef = self.encode(f)
+            t = revlog_type(f)
+            if t is None:
+                # Note: this should not be in the fncache then…
+                #
+                # However the fncache might contains such file added by
+                # previous version of Mercurial.
+                continue
+            t |= FILEFLAGS_FILELOG
             try:
-                t = revlog_type(f)
-                assert t is not None, f
-                t |= FILEFLAGS_FILELOG
                 yield t, f, self.getsize(ef)
             except FileNotFoundError:
                 pass