# HG changeset patch # User Pierre-Yves David # Date 2023-05-15 07:00:46 # Node ID 92611344aec2cc369af86e7588a9e4b03806f955 # Parent 85c5b4b507afe8b5326c0b3f458b111983c247fc store: use StoreEntry API instead of parsing filename when listing manifestlog This is more explicit and more robust. diff --git a/mercurial/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -24,6 +24,7 @@ from . import ( phases, requirements, scmutil, + store, transaction, util, ) @@ -445,13 +446,12 @@ def manifestrevlogs(repo): # 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):