# HG changeset patch # User Pierre-Yves David # Date 1684134129 -7200 # Node ID 3473d18c029ada9c7dfb5f7d32e2054b1b6feb9c # Parent 5f636e0fec4ae8a61330df142549b9c0a34b6642 store: introduce a main_file_path method for revlog This help code that need to point revlog to an index file. This is put to use in the upgrade code. diff -r 5f636e0fec4a -r 3473d18c029a mercurial/store.py --- a/mercurial/store.py Mon May 15 09:01:53 2023 +0200 +++ b/mercurial/store.py Mon May 15 09:02:09 2023 +0200 @@ -524,6 +524,10 @@ self.target_id = target_id self.is_revlog_main = is_revlog_main + def main_file_path(self): + """unencoded path of the main revlog file""" + return self.unencoded_path + @attr.s(slots=True) class StoreFile: diff -r 5f636e0fec4a -r 3473d18c029a mercurial/upgrade_utils/engine.py --- a/mercurial/upgrade_utils/engine.py Mon May 15 09:01:53 2023 +0200 +++ b/mercurial/upgrade_utils/engine.py Mon May 15 09:02:09 2023 +0200 @@ -90,7 +90,7 @@ util.copyfile(olddata, newdata) if entry.revlog_type & store.FILEFLAGS_FILELOG: - unencodedname = entry.unencoded_path + unencodedname = entry.main_file_path() destrepo.svfs.fncache.add(unencodedname) if copydata: destrepo.svfs.fncache.add(unencodedname[:-2] + b'.d') @@ -132,7 +132,7 @@ ): """returns the new revlog object created""" newrl = None - revlog_path = entry.unencoded_path + revlog_path = entry.main_file_path() if matchrevlog(upgrade_op.revlogs_to_process, entry.revlog_type): ui.note( _(b'cloning %d revisions from %s\n')