changeset 50487:92611344aec2

store: use StoreEntry API instead of parsing filename when listing manifestlog This is more explicit and more robust.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 15 May 2023 09:00:46 +0200
parents 85c5b4b507af
children b4a9c8f18928
files mercurial/repair.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/repair.py	Mon May 15 09:00:28 2023 +0200
+++ b/mercurial/repair.py	Mon May 15 09:00:46 2023 +0200
@@ -24,6 +24,7 @@
     phases,
     requirements,
     scmutil,
+    store,
     transaction,
     util,
 )
@@ -445,13 +446,12 @@
         # This logic is safe if treemanifest isn't enabled, but also
         # pointless, so we skip it if treemanifest isn't enabled.
         for entry in repo.store.datafiles():
-            unencoded = entry.unencoded_path
-            # XXX use the entry.revlog_type instead
-            if unencoded.startswith(b'meta/') and unencoded.endswith(
-                b'00manifest.i'
-            ):
-                dir = unencoded[5:-12]
-                yield repo.manifestlog.getstorage(dir)
+            if not entry.is_revlog:
+                continue
+            if not entry.revlog_type == store.FILEFLAGS_MANIFESTLOG:
+                continue
+            if entry.is_revlog_main:
+                yield repo.manifestlog.getstorage(entry.target_id)
 
 
 def rebuildfncache(ui, repo, only_data=False):