changeset 52721:2e82bd50978c

stream: acknowledge the end of the bundle part earlier See inline documentation and next commit for details.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 28 Nov 2024 11:05:26 +0100
parents ca17d31624ac
children 492de5c0ecdd
files mercurial/streamclone.py tests/test-clone-stream-revlog-split.t tests/test-stream-bundle-v2.t
diffstat 3 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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