Mercurial > public > mercurial-scm > hg-stable
diff mercurial/verify.py @ 50505: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 | d09a57ce6fc4 |
children | 9fdc28e21b68 |
line wrap: on
line diff
--- a/mercurial/verify.py Mon May 15 08:56:08 2023 +0200 +++ b/mercurial/verify.py Mon May 15 08:56:23 2023 +0200 @@ -407,7 +407,9 @@ subdirs = set() revlogv1 = self.revlogv1 undecodable = [] - for t, f, size in repo.store.datafiles(undecodable=undecodable): + for entry in repo.store.datafiles(undecodable=undecodable): + f = entry.unencoded_path + size = entry.file_size if (size > 0 or not revlogv1) and f.startswith(b'meta/'): storefiles.add(_normpath(f)) subdirs.add(os.path.dirname(f)) @@ -472,7 +474,9 @@ storefiles = set() undecodable = [] - for t, f, size in repo.store.datafiles(undecodable=undecodable): + for entry in repo.store.datafiles(undecodable=undecodable): + size = entry.file_size + f = entry.unencoded_path if (size > 0 or not revlogv1) and f.startswith(b'data/'): storefiles.add(_normpath(f)) for f in undecodable: