changeset 37813:58bbd14b0c62 stable

sshpeer: reflect actual command activity one handshake The output from devel-peer-request is expected to give data about request and roundtrip done to the server. Changeset a9cffd14aa04 changed some of that by grouping hello and between commands call. However, the old sequence of command was "emulated" in sshpeer. Update the sshpeer to reflect this grouping of commands and update the tests that use it.
author Boris Feld <boris.feld@octobus.net>
date Mon, 23 Apr 2018 19:23:18 +0100
parents 91b717e2cafa
children 265c122b69aa
files mercurial/sshpeer.py tests/test-debugcommands.t tests/test-ssh-proto.t tests/test-ssh.t
diffstat 4 files changed, 22 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/sshpeer.py	Mon Apr 23 23:24:53 2018 -0400
+++ b/mercurial/sshpeer.py	Mon Apr 23 19:23:18 2018 +0100
@@ -261,11 +261,9 @@
             handshake.insert(0, 'upgrade %s %s\n' % (token, upgradecaps))
 
         if requestlog:
-            ui.debug('devel-peer-request: hello\n')
+            ui.debug('devel-peer-request: hello+between\n')
+            ui.debug('devel-peer-request:   pairs: %d bytes\n' % len(pairsarg))
         ui.debug('sending hello command\n')
-        if requestlog:
-            ui.debug('devel-peer-request: between\n')
-            ui.debug('devel-peer-request:   pairs: %d bytes\n' % len(pairsarg))
         ui.debug('sending between command\n')
 
         stdin.write(''.join(handshake))
--- a/tests/test-debugcommands.t	Mon Apr 23 23:24:53 2018 -0400
+++ b/tests/test-debugcommands.t	Mon Apr 23 19:23:18 2018 +0100
@@ -411,10 +411,9 @@
   $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" --debug debugpeer ssh://user@dummy/debugrevlog
   running "*" "*/tests/dummyssh" 'user@dummy' 'hg -R debugrevlog serve --stdio' (glob) (no-windows !)
   running "*" "*\tests/dummyssh" "user@dummy" "hg -R debugrevlog serve --stdio" (glob) (windows !)
-  devel-peer-request: hello
+  devel-peer-request: hello+between
+  devel-peer-request:   pairs: 81 bytes
   sending hello command
-  devel-peer-request: between
-  devel-peer-request:   pairs: 81 bytes
   sending between command
   remote: 413
   remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
--- a/tests/test-ssh-proto.t	Mon Apr 23 23:24:53 2018 -0400
+++ b/tests/test-ssh-proto.t	Mon Apr 23 19:23:18 2018 +0100
@@ -58,10 +58,9 @@
   $ hg --debug debugpeer ssh://user@dummy/server
   running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
   running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
-  devel-peer-request: hello
+  devel-peer-request: hello+between
+  devel-peer-request:   pairs: 81 bytes
   sending hello command
-  devel-peer-request: between
-  devel-peer-request:   pairs: 81 bytes
   sending between command
   remote: 413
   remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
@@ -170,10 +169,9 @@
   $ SSHSERVERMODE=banner hg --debug debugpeer ssh://user@dummy/server
   running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
   running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
-  devel-peer-request: hello
+  devel-peer-request: hello+between
+  devel-peer-request:   pairs: 81 bytes
   sending hello command
-  devel-peer-request: between
-  devel-peer-request:   pairs: 81 bytes
   sending between command
   remote: banner: line 0
   remote: banner: line 1
@@ -262,10 +260,9 @@
   $ SSHSERVERMODE=no-hello hg --debug debugpeer ssh://user@dummy/server
   running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
   running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
-  devel-peer-request: hello
+  devel-peer-request: hello+between
+  devel-peer-request:   pairs: 81 bytes
   sending hello command
-  devel-peer-request: between
-  devel-peer-request:   pairs: 81 bytes
   sending between command
   remote: 0
   remote: 1
@@ -310,10 +307,9 @@
   running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
   running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
   sending no-args command
-  devel-peer-request: hello
+  devel-peer-request: hello+between
+  devel-peer-request:   pairs: 81 bytes
   sending hello command
-  devel-peer-request: between
-  devel-peer-request:   pairs: 81 bytes
   sending between command
   remote: 0
   remote: 413
@@ -383,10 +379,9 @@
   sending unknown1 command
   sending unknown2 command
   sending unknown3 command
-  devel-peer-request: hello
+  devel-peer-request: hello+between
+  devel-peer-request:   pairs: 81 bytes
   sending hello command
-  devel-peer-request: between
-  devel-peer-request:   pairs: 81 bytes
   sending between command
   remote: 0
   remote: 0
@@ -958,10 +953,9 @@
   running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
   running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
   sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
-  devel-peer-request: hello
+  devel-peer-request: hello+between
+  devel-peer-request:   pairs: 81 bytes
   sending hello command
-  devel-peer-request: between
-  devel-peer-request:   pairs: 81 bytes
   sending between command
   remote: 0
   remote: 413
@@ -1017,10 +1011,9 @@
   running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
   running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
   sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
-  devel-peer-request: hello
+  devel-peer-request: hello+between
+  devel-peer-request:   pairs: 81 bytes
   sending hello command
-  devel-peer-request: between
-  devel-peer-request:   pairs: 81 bytes
   sending between command
   protocol upgraded to exp-ssh-v2-0001
   remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
@@ -1037,10 +1030,9 @@
   running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
   running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
   sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
-  devel-peer-request: hello
+  devel-peer-request: hello+between
+  devel-peer-request:   pairs: 81 bytes
   sending hello command
-  devel-peer-request: between
-  devel-peer-request:   pairs: 81 bytes
   sending between command
   protocol upgraded to exp-ssh-v2-0001
   remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
--- a/tests/test-ssh.t	Mon Apr 23 23:24:53 2018 -0400
+++ b/tests/test-ssh.t	Mon Apr 23 19:23:18 2018 +0100
@@ -490,10 +490,9 @@
   pulling from ssh://user@dummy/remote
   running .* ".*/dummyssh" ['"]user@dummy['"] ('|")hg -R remote serve --stdio('|") (re)
   sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
-  devel-peer-request: hello
+  devel-peer-request: hello+between
+  devel-peer-request:   pairs: 81 bytes
   sending hello command
-  devel-peer-request: between
-  devel-peer-request:   pairs: 81 bytes
   sending between command
   remote: 413 (sshv1 !)
   protocol upgraded to exp-ssh-v2-0001 (sshv2 !)