Mercurial > public > mercurial-scm > hg
diff mercurial/revlogutils/rewrite.py @ 50468:521fec115dad
store: use a StoreEntry object instead of tuple for store files
We want to make the store return more semantic information instead of a stream
of file path. To achieve this, we start with adding a simple object that hold
the same information as the tuple it replace, and do a simple update to the
user code to fetch and use the same information.
From there, we will be able to iteratively upgrade the codebase toward better
objects.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 15 May 2023 08:56:23 +0200 |
parents | a52aae8bcc7a |
children | 85c5b4b507af |
line wrap: on
line diff
--- a/mercurial/revlogutils/rewrite.py Mon May 15 08:56:08 2023 +0200 +++ b/mercurial/revlogutils/rewrite.py Mon May 15 08:56:23 2023 +0200 @@ -825,9 +825,13 @@ with context(): files = list( - (file_type, path) - for (file_type, path, _s) in repo.store.datafiles() - if path.endswith(b'.i') and file_type & store.FILEFLAGS_FILELOG + entry + for entry in repo.store.datafiles() + if ( + entry.unencoded_path.endswith(b'.i') + and entry.is_revlog + and entry.revlog_type == store.FILEFLAGS_FILELOG + ) ) progress = ui.makeprogress( @@ -837,7 +841,8 @@ ) found_nothing = True - for file_type, path in files: + for entry in files: + path = entry.unencoded_path progress.increment() filename = _get_filename_from_filelog_index(path) fl = _filelog_from_filename(repo, filename)