Mercurial > hg
changeset 50485:5805b8b25426
store: use StoreEntry API instead of parsing filename in remotefilelog
This is more explicit and more robust.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 15 May 2023 09:00:13 +0200 |
parents | 17a822d7943e |
children | 85c5b4b507af |
files | hgext/remotefilelog/remotefilelogserver.py |
diffstat | 1 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/remotefilelog/remotefilelogserver.py Mon May 15 08:59:56 2023 +0200 +++ b/hgext/remotefilelog/remotefilelogserver.py Mon May 15 09:00:13 2023 +0200 @@ -173,19 +173,18 @@ if scmutil.istreemanifest(repo): for entry in repo.store.datafiles(): - u = entry.unencoded_path - if u.startswith(b'meta/') and ( - u.endswith(b'.i') or u.endswith(b'.d') - ): + if not entry.is_revlog: + continue + if entry.revlog_type == store.FILEFLAGS_MANIFESTLOG: yield entry # Return .d and .i files that do not match the shallow pattern match = state.match if match and not match.always(): for entry in repo.store.datafiles(): - u = entry.unencoded_path - f = u[5:-2] # trim data/... and .i/.d - if not state.match(f): + if not entry.is_revlog: + continue + if not state.match(entry.target_id): yield entry for x in repo.store.topfiles():