# HG changeset patch # User Boris Feld # Date 2018-04-23 18:23:18 # Node ID 58bbd14b0c621bc847d7ab4d4fbe8b6907b5afa6 # Parent 91b717e2cafab34f0d7ce999c4176f6bb1f8e691 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. diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py --- a/mercurial/sshpeer.py +++ b/mercurial/sshpeer.py @@ -261,11 +261,9 @@ def _performhandshake(ui, stdin, stdout, 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)) diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t --- a/tests/test-debugcommands.t +++ b/tests/test-debugcommands.t @@ -411,10 +411,9 @@ Test debugpeer $ 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 diff --git a/tests/test-ssh-proto.t b/tests/test-ssh-proto.t --- a/tests/test-ssh-proto.t +++ b/tests/test-ssh-proto.t @@ -58,10 +58,9 @@ Test a normal behaving server, for sanit $ 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 @@ SSH banner is not printed by default, ig $ 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 @@ servers. $ 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 @@ Sending an unknown command to the 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 !) 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 @@ Send multiple unknown commands before he 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 @@ Send an upgrade request to a server that 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 @@ Send an upgrade request to a server that 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 @@ Verify the peer has capabilities 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 diff --git a/tests/test-ssh.t b/tests/test-ssh.t --- a/tests/test-ssh.t +++ b/tests/test-ssh.t @@ -490,10 +490,9 @@ debug output 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 !)