--- a/mercurial/streamclone.py Mon Jan 20 12:16:54 2025 +0100
+++ b/mercurial/streamclone.py Mon Jan 20 12:32:37 2025 +0100
@@ -1110,11 +1110,7 @@
progress,
report,
)
- for src, name, chunks in files:
- vfs = vfsmap[src]
- with vfs(name, b'w') as ofp:
- for c in chunks:
- ofp.write(c)
+ _write_files(vfsmap, files)
# force @filecache properties to be reloaded from
# streamclone-ed file at next access
@@ -1182,6 +1178,15 @@
yield (src, name, _v2_file_chunk(fp, datalen, progress, report))
+def _write_files(vfsmap, info: Iterable[FileInfoT]):
+ """write files from parsed data"""
+ for src, name, data in info:
+ vfs = vfsmap[src]
+ with vfs(name, b'w') as ofp:
+ for chunk in data:
+ ofp.write(chunk)
+
+
def consumev3(repo, fp) -> None:
"""Apply the contents from a version 3 streaming clone.