debugcommands: ability to suppress logging of handshake
The tests for calling wire protocol commands were getting quite
verbose because they included the results of the capabilities
request. Furthermore, it was annoying to have to update several
tests every time the capabilities response changed.
The only tests that really care about the low-level details of
the capabilities requests are those testing the protocol
handshake. And those are mostly not instantiating peer instances
or are contained to limited files.
This commit adds an option to `hg debugwireproto` to suppress logging
of the handshake. The shell helper function to perform HTTP tests
has been updated to use this by default. Lots of excessive test
output has gone away.
Differential Revision: https://phab.mercurial-scm.org/D3378
--- a/mercurial/debugcommands.py Sat Apr 14 09:57:44 2018 -0700
+++ b/mercurial/debugcommands.py Sat Apr 14 11:49:57 2018 -0700
@@ -2626,6 +2626,8 @@
('', 'localssh', False, _('start an SSH server for this repo')),
('', 'peer', '', _('construct a specific version of the peer')),
('', 'noreadstderr', False, _('do not read from stderr of the remote')),
+ ('', 'nologhandshake', False,
+ _('do not log I/O related to the peer handshake')),
] + cmdutil.remoteopts,
_('[PATH]'),
optionalrepo=True)
@@ -2921,8 +2923,14 @@
# the peer instance to be useful.
with ui.configoverride({
('experimental', 'httppeer.advertise-v2'): True}):
+ if opts['nologhandshake']:
+ ui.pushbuffer()
+
peer = httppeer.makepeer(ui, path, opener=opener)
+ if opts['nologhandshake']:
+ ui.popbuffer()
+
if not isinstance(peer, httppeer.httpv2peer):
raise error.Abort(_('could not instantiate HTTP peer for '
'wire protocol version 2'),
--- a/tests/test-completion.t Sat Apr 14 09:57:44 2018 -0700
+++ b/tests/test-completion.t Sat Apr 14 11:49:57 2018 -0700
@@ -309,7 +309,7 @@
debugwalk: include, exclude
debugwhyunstable:
debugwireargs: three, four, five, ssh, remotecmd, insecure
- debugwireproto: localssh, peer, noreadstderr, ssh, remotecmd, insecure
+ debugwireproto: localssh, peer, noreadstderr, nologhandshake, ssh, remotecmd, insecure
files: rev, print0, include, exclude, template, subrepos
graft: rev, continue, edit, log, force, currentdate, currentuser, date, user, tool, dry-run
grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, template, include, exclude
--- a/tests/test-http-api-httpv2.t Sat Apr 14 09:57:44 2018 -0700
+++ b/tests/test-http-api-httpv2.t Sat Apr 14 11:49:57 2018 -0700
@@ -184,23 +184,6 @@
> command customreadonly
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa9Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullNcustomreadonly\xa2Dargs\xa0Kpermissions\x81DpullOcustomreadwrite\xa2Dargs\xa0Kpermissions\x81DpushKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending customreadonly command
s> POST /api/exp-http-v2-0001/ro/customreadonly HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
--- a/tests/test-wireproto-command-branchmap.t Sat Apr 14 09:57:44 2018 -0700
+++ b/tests/test-wireproto-command-branchmap.t Sat Apr 14 11:49:57 2018 -0700
@@ -42,23 +42,6 @@
> command branchmap
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending branchmap command
s> POST /api/exp-http-v2-0001/ro/branchmap HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
--- a/tests/test-wireproto-command-capabilities.t Sat Apr 14 09:57:44 2018 -0700
+++ b/tests/test-wireproto-command-capabilities.t Sat Apr 14 11:49:57 2018 -0700
@@ -197,11 +197,11 @@
capabilities command returns expected info
- $ sendhttpv2peer << EOF
+ $ sendhttpv2peerhandshake << EOF
> command capabilities
> EOF
creating http peer for wire protocol version 2
- s> *\r\n (glob)
+ s> GET /?cmd=capabilities HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
s> x-hgproto-1: cbor\r\n
--- a/tests/test-wireproto-command-heads.t Sat Apr 14 09:57:44 2018 -0700
+++ b/tests/test-wireproto-command-heads.t Sat Apr 14 11:49:57 2018 -0700
@@ -34,23 +34,6 @@
> command heads
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa3Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xa9batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending heads command
s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
@@ -84,23 +67,6 @@
> publiconly 1
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa3Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xa9batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending heads command
s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
--- a/tests/test-wireproto-command-known.t Sat Apr 14 09:57:44 2018 -0700
+++ b/tests/test-wireproto-command-known.t Sat Apr 14 11:49:57 2018 -0700
@@ -26,23 +26,6 @@
> command known
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending known command
s> POST /api/exp-http-v2-0001/ro/known HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
@@ -76,23 +59,6 @@
> nodes eval:[b'\x42\x6b\xad\xa5\xc6\x75\x98\xca\x65\x03\x6d\x57\xd9\xe4\xb6\x4b\x0c\x1c\xe7\xa0']
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending known command
s> POST /api/exp-http-v2-0001/ro/known HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
@@ -126,23 +92,6 @@
> nodes eval:[b'\x42\x6b\xad\xa5\xc6\x75\x98\xca\x65\x03\x6d\x57\xd9\xe4\xb6\x4b\x0c\x1c\xe7\xa0', b'00000000000000000000', b'\x11\x24\x78\x96\x29\x61\x14\x71\x24\xed\xd4\x35\x49\xae\xdd\x1a\x33\x5e\x44\xbf']
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending known command
s> POST /api/exp-http-v2-0001/ro/known HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
--- a/tests/test-wireproto-command-listkeys.t Sat Apr 14 09:57:44 2018 -0700
+++ b/tests/test-wireproto-command-listkeys.t Sat Apr 14 11:49:57 2018 -0700
@@ -30,23 +30,6 @@
> namespace namespaces
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending listkeys command
s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
@@ -80,23 +63,6 @@
> namespace phases
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending listkeys command
s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
@@ -130,23 +96,6 @@
> namespace bookmarks
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending listkeys command
s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
--- a/tests/test-wireproto-command-lookup.t Sat Apr 14 09:57:44 2018 -0700
+++ b/tests/test-wireproto-command-lookup.t Sat Apr 14 11:49:57 2018 -0700
@@ -26,23 +26,6 @@
> key 426bada5c67598ca65036d57d9e4b64b0c1ce7a0
> EOF
creating http peer for wire protocol version 2
- s> *\r\n (glob)
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending lookup command
s> *\r\n (glob)
s> Accept-Encoding: identity\r\n
--- a/tests/test-wireproto-command-pushkey.t Sat Apr 14 09:57:44 2018 -0700
+++ b/tests/test-wireproto-command-pushkey.t Sat Apr 14 11:49:57 2018 -0700
@@ -29,23 +29,6 @@
> new 426bada5c67598ca65036d57d9e4b64b0c1ce7a0
> EOF
creating http peer for wire protocol version 2
- s> *\r\n (glob)
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending pushkey command
s> *\r\n (glob)
s> Accept-Encoding: identity\r\n
@@ -77,23 +60,6 @@
> namespace bookmarks
> EOF
creating http peer for wire protocol version 2
- s> GET /?cmd=capabilities HTTP/1.1\r\n
- s> Accept-Encoding: identity\r\n
- s> vary: X-HgProto-1,X-HgUpgrade-1\r\n
- s> x-hgproto-1: cbor\r\n
- s> x-hgupgrade-1: exp-http-v2-0001\r\n
- s> accept: application/mercurial-0.1\r\n
- s> host: $LOCALIP:$HGPORT\r\n (glob)
- s> user-agent: Mercurial debugwireproto\r\n
- s> \r\n
- s> makefile('rb', None)
- s> HTTP/1.1 200 OK\r\n
- s> Server: testing stub value\r\n
- s> Date: $HTTP_DATE$\r\n
- s> Content-Type: application/mercurial-cbor\r\n
- s> Content-Length: *\r\n (glob)
- s> \r\n
- s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0003GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
sending listkeys command
s> POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
s> Accept-Encoding: identity\r\n
--- a/tests/wireprotohelpers.sh Sat Apr 14 09:57:44 2018 -0700
+++ b/tests/wireprotohelpers.sh Sat Apr 14 11:49:57 2018 -0700
@@ -6,6 +6,10 @@
}
sendhttpv2peer() {
+ hg --verbose debugwireproto --nologhandshake --peer http2 http://$LOCALIP:$HGPORT/
+}
+
+sendhttpv2peerhandshake() {
hg --verbose debugwireproto --peer http2 http://$LOCALIP:$HGPORT/
}