Mercurial > public > mercurial-scm > hg-stable
diff mercurial/streamclone.py @ 50506:9fdc28e21b68
store: introduce a EntryFile object to actually access file info
For now a StoreEntry match a single file, but the goal is to eventually combine
multiple file in a higher level Entry, so we need to introduce this distinction
and use it first.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 15 May 2023 08:56:40 +0200 |
parents | 521fec115dad |
children | 4cbdfab6f812 |
line wrap: on
line diff
--- a/mercurial/streamclone.py Mon May 15 08:56:23 2023 +0200 +++ b/mercurial/streamclone.py Mon May 15 08:56:40 2023 +0200 @@ -270,9 +270,10 @@ with repo.lock(): repo.ui.debug(b'scanning\n') for entry in _walkstreamfiles(repo): - if entry.file_size: - entries.append((entry.unencoded_path, entry.file_size)) - total_bytes += entry.file_size + for f in entry.files(): + if f.file_size: + entries.append((f.unencoded_path, f.file_size)) + total_bytes += f.file_size _test_sync_point_walk_1(repo) _test_sync_point_walk_2(repo) @@ -678,14 +679,13 @@ matcher = narrowspec.match(repo.root, includes, excludes) for entry in _walkstreamfiles(repo, matcher): - if entry.file_size: - ft = _fileappend - if entry.is_volatile: - ft = _filefull - entries.append( - (_srcstore, entry.unencoded_path, ft, entry.file_size) - ) - totalfilesize += entry.file_size + for f in entry.files(): + if f.file_size: + ft = _fileappend + if f.is_volatile: + ft = _filefull + entries.append((_srcstore, f.unencoded_path, ft, f.file_size)) + totalfilesize += f.file_size for name in _walkstreamfullstorefiles(repo): if repo.svfs.exists(name): totalfilesize += repo.svfs.lstat(name).st_size