diff tests/test-bookmarks-pushpull.t @ 35264:a1e70c1dbec0

bookmark: use the 'bookmarks' bundle2 part to push bookmark update (issue5165) We use the new binary parts we introduced earlier to exchange bookmark. The payload is a bit more compact since we use binary and the length of bookmarks is no longer constrained to 255. .. fix:: Issue 5165 Bookmark, whose name is longer than 255, can again be exchanged again between 4.4+ client and servers.
author Boris Feld <boris.feld@octobus.net>
date Tue, 17 Oct 2017 12:38:13 +0200
parents ae79d878702b
children 4441705b7111
line wrap: on
line diff
--- a/tests/test-bookmarks-pushpull.t	Tue Oct 17 12:37:39 2017 +0200
+++ b/tests/test-bookmarks-pushpull.t	Tue Oct 17 12:38:13 2017 +0200
@@ -1,4 +1,12 @@
 #testcases b2-pushkey b2-binary
+
+#if b2-pushkey
+  $ cat << EOF >> $HGRCPATH
+  > [devel]
+  > legacy.exchange=bookmarks
+  > EOF
+#endif
+
 #require serve
 
   $ cat << EOF >> $HGRCPATH
@@ -250,10 +258,11 @@
   bundle2-output: header chunk size: 19
   bundle2-output: payload chunk size: 48
   bundle2-output: closing payload chunk
-  bundle2-output: bundle part: "pushkey"
-  bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
-  bundle2-output: part 3: "PUSHKEY"
-  bundle2-output: header chunk size: 90
+  bundle2-output: bundle part: "bookmarks"
+  bundle2-output-part: "bookmarks" 23 bytes payload
+  bundle2-output: part 3: "BOOKMARKS"
+  bundle2-output: header chunk size: 16
+  bundle2-output: payload chunk size: 23
   bundle2-output: closing payload chunk
   bundle2-output: end of bundle
   bundle2-input: start processing of HG20 stream
@@ -287,40 +296,29 @@
   bundle2-input: payload chunk size: 48
   bundle2-input: payload chunk size: 0
   bundle2-input-part: total payload size 48
-  bundle2-input: part header size: 90
-  bundle2-input: part type: "PUSHKEY"
+  bundle2-input: part header size: 16
+  bundle2-input: part type: "BOOKMARKS"
   bundle2-input: part id: "3"
-  bundle2-input: part parameters: 4
-  bundle2-input: found a handler for part pushkey
-  bundle2-input-part: "pushkey" (params: 4 mandatory) supported
-  pushing key for "bookmarks:W"
+  bundle2-input: part parameters: 0
+  bundle2-input: found a handler for part bookmarks
+  bundle2-input-part: "bookmarks" supported
+  bundle2-input: payload chunk size: 23
   bundle2-input: payload chunk size: 0
+  bundle2-input-part: total payload size 23
   bundle2-input: part header size: 0
   bundle2-input: end of bundle2 stream
   bundle2-input-bundle: 3 parts total
   running hook txnclose-bookmark.test: sh $TESTTMP/hook.sh
   test-hook-bookmark: W:  0000000000000000000000000000000000000000 -> 
-  bundle2-output-bundle: "HG20", 1 parts total
+  bundle2-output-bundle: "HG20", 0 parts total
   bundle2-output: start emission of HG20 stream
   bundle2-output: bundle parameter: 
   bundle2-output: start of parts
-  bundle2-output: bundle part: "reply:pushkey"
-  bundle2-output-part: "reply:pushkey" (params: 0 advisory) empty payload
-  bundle2-output: part 0: "REPLY:PUSHKEY"
-  bundle2-output: header chunk size: 43
-  bundle2-output: closing payload chunk
   bundle2-output: end of bundle
   bundle2-input: start processing of HG20 stream
   bundle2-input: reading bundle2 stream parameters
   bundle2-input-bundle: no-transaction
   bundle2-input: start extraction of bundle2 parts
-  bundle2-input: part header size: 43
-  bundle2-input: part type: "REPLY:PUSHKEY"
-  bundle2-input: part id: "0"
-  bundle2-input: part parameters: 2
-  bundle2-input: found a handler for part reply:pushkey
-  bundle2-input-part: "reply:pushkey" (params: 0 advisory) supported
-  bundle2-input: payload chunk size: 0
   bundle2-input: part header size: 0
   bundle2-input: end of bundle2 stream
   bundle2-input-bundle: 0 parts total
@@ -1088,8 +1086,7 @@
   pushing to $TESTTMP/issue4455-dest (glob)
   searching for changes
   no changes found
-  pushkey-abort: prepushkey hook exited with status 1
-  abort: exporting bookmark @ failed!
+  abort: prepushkey hook exited with status 1
   [255]
 
 #endif
@@ -1128,8 +1125,8 @@
   pushing to ssh://user@dummy/issue4455-dest
   searching for changes
   no changes found
-  remote: pushkey-abort: prepushkey hook exited with status 1
-  abort: exporting bookmark @ failed!
+  remote: prepushkey hook exited with status 1
+  abort: push failed on remote
   [255]
 
 #endif
@@ -1168,8 +1165,8 @@
   pushing to ssh://user@dummy/issue4455-dest
   searching for changes
   no changes found
-  remote: pushkey-abort: prepushkey hook exited with status 1
-  abort: exporting bookmark @ failed!
+  remote: prepushkey hook exited with status 1
+  abort: push failed on remote
   [255]
 
 #endif