# HG changeset patch # User Pierre-Yves David # Date 2023-05-21 01:21:00 # Node ID 43ed1f12b00a76d3c34ea35b6967a5e7e21d7081 # Parent 06d580b8f432984366703fd4546516c27d366af9 stream-clone: yield cache entry in `_entries_walk` too The new function now cover the same ground as _v2_walk. diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py --- a/mercurial/streamclone.py +++ b/mercurial/streamclone.py @@ -682,6 +682,15 @@ def _entries_walk(repo, includes, exclud for entry in entries: yield (_srcstore, entry) + for name in cacheutil.cachetocopy(repo): + if repo.cachevfs.exists(name): + # not really a StoreEntry, but close enough + entry = store.SimpleStoreEntry( + entry_path=name, + is_volatile=True, + ) + yield (_srccache, entry) + def _v2_walk(repo, includes, excludes, includeobsmarkers): """emit a seris of files information useful to clone a repo @@ -711,10 +720,6 @@ def _v2_walk(repo, includes, excludes, i ft = _filefull files.append((vfs_key, f.unencoded_path, ft, file_size)) totalfilesize += file_size - for name in cacheutil.cachetocopy(repo): - if repo.cachevfs.exists(name): - totalfilesize += repo.cachevfs.lstat(name).st_size - files.append((_srccache, name, _filefull, None)) return files, totalfilesize