# HG changeset patch # User Pierre-Yves David # Date 1684134013 -7200 # Node ID 5805b8b254267fc33bd3681da53e4f976432319f # Parent 17a822d7943ed273c0556da1b64f7e064a85f03e store: use StoreEntry API instead of parsing filename in remotefilelog This is more explicit and more robust. diff -r 17a822d7943e -r 5805b8b25426 hgext/remotefilelog/remotefilelogserver.py --- 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():