stream: acknowledge the end of the bundle part earlier
See inline documentation and next commit for details.
--- a/mercurial/streamclone.py Thu Nov 28 11:05:16 2024 +0100
+++ b/mercurial/streamclone.py Thu Nov 28 11:05:26 2024 +0100
@@ -1115,6 +1115,10 @@
repo.invalidate(clearfilecache=True)
progress.complete()
+ # acknowledge the end of the bundle2 part, this help aligning
+ # sequential and parallel behavior.
+ remains = fp.read(1)
+ assert not remains
_report_transferred(repo, start, filecount, byte_count)
--- a/tests/test-clone-stream-revlog-split.t Thu Nov 28 11:05:16 2024 +0100
+++ b/tests/test-clone-stream-revlog-split.t Thu Nov 28 11:05:26 2024 +0100
@@ -124,14 +124,14 @@
adding [c] rbc-names-v2 (7 bytes)
adding [c] rbc-revs-v2 (24 bytes)
updating the branch cache
- stream-cloned 8 files / 2.11 KB in * seconds (* */sec) (glob) (no-rust stream-bundle2-v2 !)
stream-cloned 9 files / 2.11 KB in * seconds (* */sec) (glob) (no-rust stream-bundle2-v3 !)
- stream-cloned 10 files / 2.29 KB in * seconds (* */sec) (glob) (rust stream-bundle2-v2 !)
stream-cloned 11 files / 2.29 KB in * seconds (* */sec) (glob) (rust stream-bundle2-v3 !)
bundle2-input-part: total payload size 2285 (stream-bundle2-v2 no-rust !)
bundle2-input-part: total payload size 2518 (stream-bundle2-v2 rust !)
bundle2-input-part: total payload size 2313 (stream-bundle2-v3 no-rust !)
bundle2-input-part: total payload size 2546 (stream-bundle2-v3 rust !)
+ stream-cloned 8 files / 2.11 KB in * seconds (* */sec) (glob) (no-rust stream-bundle2-v2 !)
+ stream-cloned 10 files / 2.29 KB in * seconds (* */sec) (glob) (rust stream-bundle2-v2 !)
bundle2-input-part: "listkeys" (params: 1 mandatory) supported
bundle2-input-bundle: 2 parts total
checking for updated bookmarks
--- a/tests/test-stream-bundle-v2.t Thu Nov 28 11:05:16 2024 +0100
+++ b/tests/test-stream-bundle-v2.t Thu Nov 28 11:05:26 2024 +0100
@@ -132,10 +132,10 @@
adding [c] branch2-served (94 bytes)
adding [c] rbc-names-v2 (7 bytes)
adding [c] rbc-revs-v2 (40 bytes)
+ bundle2-input-part: total payload size 1857 (no-rust !)
+ bundle2-input-part: total payload size 2025 (rust !)
stream-cloned 12 files / 1.65 KB in * seconds (* */sec) (glob) (no-rust !)
- bundle2-input-part: total payload size 1857 (no-rust !)
stream-cloned 14 files / 1.78 KB in * seconds (* */sec) (glob) (rust !)
- bundle2-input-part: total payload size 2025 (rust !)
bundle2-input-bundle: 1 parts total
updating the branch cache
finished applying clone bundle
@@ -195,10 +195,10 @@
adding [c] branch2-served (94 bytes)
adding [c] rbc-names-v2 (7 bytes)
adding [c] rbc-revs-v2 (40 bytes)
+ bundle2-input-part: total payload size 1857 (no-rust !)
+ bundle2-input-part: total payload size 2025 (rust !)
stream-cloned 12 files / 1.65 KB in * seconds (* */sec) (glob) (no-rust !)
- bundle2-input-part: total payload size 1857 (no-rust !)
stream-cloned 14 files / 1.78 KB in * seconds (* */sec) (glob) (rust !)
- bundle2-input-part: total payload size 2025 (rust !)
bundle2-input-bundle: 1 parts total
updating the branch cache
finished applying clone bundle