tests/test-wireproto-command-listkeys.t
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 12 Apr 2018 12:33:07 -0700
changeset 37645 72b0982cd509
parent 37487 68915b9f8e96
child 37653 b2fa1591fb44
permissions -rw-r--r--
debugcommands: perform handshake when obtaining httpv2 peer If we obtain an httpv2peer directly, the instance doesn't have an API descriptor and therefore doesn't know about the remote's commands, feature support, etc. This doesn't matter now. But when we implement the peer so it consults the API descriptor as part of sending commands, it will. So we change the logic for obtaining an http version 2 peer to go through makepeer() so the peer will perform the handshake and pass the API descriptor to the httpv2peer instance. Tests changed because we now perform a ?cmd=capabilities when obtaining version 2 peers. The Content-Length header is globbed because compression info will lack zstandard for pure builds. Differential Revision: https://phab.mercurial-scm.org/D3296
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37487
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
  $ . $TESTDIR/wireprotohelpers.sh
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
  $ hg init server
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
  $ enablehttpv2 server
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
  $ cd server
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
  $ hg debugdrawdag << EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
  > C D
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
  > |/
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
  > B
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
  > |
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
  > A
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
  > EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
  $ hg phase --public -r C
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
  $ hg book -r C @
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
  $ hg log -T '{rev}:{node} {desc}\n'
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
  3:be0ef73c17ade3fc89dc41701eb9fc3a91b58282 D
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
  2:26805aba1e600a82e93661149f2313866a221a7b C
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
  1:112478962961147124edd43549aedd1a335e44bf B
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
  0:426bada5c67598ca65036d57d9e4b64b0c1ce7a0 A
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
  $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
  $ cat hg.pid > $DAEMON_PIDS
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
Request for namespaces works
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
  $ sendhttpv2peer << EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
  > command listkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
  >     namespace namespaces
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
  > EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
  creating http peer for wire protocol version 2
37645
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    33
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    34
  s>     Accept-Encoding: identity\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    35
  s>     vary: X-HgProto-1,X-HgUpgrade-1\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    36
  s>     x-hgproto-1: cbor\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    37
  s>     x-hgupgrade-1: exp-http-v2-0001\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    38
  s>     accept: application/mercurial-0.1\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    39
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    40
  s>     user-agent: Mercurial debugwireproto\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    41
  s>     \r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    42
  s> makefile('rb', None)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    43
  s>     HTTP/1.1 200 OK\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    44
  s>     Server: testing stub value\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    45
  s>     Date: $HTTP_DATE$\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    46
  s>     Content-Type: application/mercurial-cbor\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    47
  s>     Content-Length: *\r\n (glob)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    48
  s>     \r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    49
  s>     \xa3Dapis\xa1Pexp-http-v2-0001\xa2Hcommands\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\xa1DnameDzlibGapibaseDapi/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
37487
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
  sending listkeys command
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
  s>     POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
  s>     Accept-Encoding: identity\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    53
  s>     accept: application/mercurial-exp-framing-0003\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    54
  s>     content-type: application/mercurial-exp-framing-0003\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
  s>     content-length: 50\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    56
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
  s>     user-agent: Mercurial debugwireproto\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    59
  s>     *\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa1InamespaceJnamespacesDnameHlistkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    60
  s> makefile('rb', None)
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    61
  s>     HTTP/1.1 200 OK\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    62
  s>     Server: testing stub value\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    63
  s>     Date: $HTTP_DATE$\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    64
  s>     Content-Type: application/mercurial-exp-framing-0003\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    65
  s>     Transfer-Encoding: chunked\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    66
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    67
  s>     28\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    68
  s>      \x00\x00\x01\x00\x02\x01F
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    69
  s>     \xa3Fphases@Ibookmarks@Jnamespaces@
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    70
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    71
  received frame(size=32; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    72
  s>     0\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    73
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    74
  response: [{b'bookmarks': b'', b'namespaces': b'', b'phases': b''}]
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    76
Request for phases works
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    77
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    78
  $ sendhttpv2peer << EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    79
  > command listkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    80
  >     namespace phases
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    81
  > EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    82
  creating http peer for wire protocol version 2
37645
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    83
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    84
  s>     Accept-Encoding: identity\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    85
  s>     vary: X-HgProto-1,X-HgUpgrade-1\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    86
  s>     x-hgproto-1: cbor\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    87
  s>     x-hgupgrade-1: exp-http-v2-0001\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    88
  s>     accept: application/mercurial-0.1\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    89
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    90
  s>     user-agent: Mercurial debugwireproto\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    91
  s>     \r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    92
  s> makefile('rb', None)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    93
  s>     HTTP/1.1 200 OK\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    94
  s>     Server: testing stub value\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    95
  s>     Date: $HTTP_DATE$\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    96
  s>     Content-Type: application/mercurial-cbor\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    97
  s>     Content-Length: *\r\n (glob)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    98
  s>     \r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
    99
  s>     \xa3Dapis\xa1Pexp-http-v2-0001\xa2Hcommands\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\xa1DnameDzlibGapibaseDapi/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
37487
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   100
  sending listkeys command
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   101
  s>     POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   102
  s>     Accept-Encoding: identity\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   103
  s>     accept: application/mercurial-exp-framing-0003\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   104
  s>     content-type: application/mercurial-exp-framing-0003\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   105
  s>     content-length: 46\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   106
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   107
  s>     user-agent: Mercurial debugwireproto\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   108
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   109
  s>     &\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa1InamespaceFphasesDnameHlistkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   110
  s> makefile('rb', None)
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   111
  s>     HTTP/1.1 200 OK\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   112
  s>     Server: testing stub value\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   113
  s>     Date: $HTTP_DATE$\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   114
  s>     Content-Type: application/mercurial-exp-framing-0003\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   115
  s>     Transfer-Encoding: chunked\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   116
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   117
  s>     45\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   118
  s>     =\x00\x00\x01\x00\x02\x01F
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   119
  s>     \xa2JpublishingDTrueX(be0ef73c17ade3fc89dc41701eb9fc3a91b58282A1
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   120
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   121
  received frame(size=61; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   122
  s>     0\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   123
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   124
  response: [{b'be0ef73c17ade3fc89dc41701eb9fc3a91b58282': b'1', b'publishing': b'True'}]
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   125
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   126
Request for bookmarks works
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   127
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   128
  $ sendhttpv2peer << EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   129
  > command listkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   130
  >     namespace bookmarks
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   131
  > EOF
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   132
  creating http peer for wire protocol version 2
37645
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   133
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   134
  s>     Accept-Encoding: identity\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   135
  s>     vary: X-HgProto-1,X-HgUpgrade-1\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   136
  s>     x-hgproto-1: cbor\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   137
  s>     x-hgupgrade-1: exp-http-v2-0001\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   138
  s>     accept: application/mercurial-0.1\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   139
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   140
  s>     user-agent: Mercurial debugwireproto\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   141
  s>     \r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   142
  s> makefile('rb', None)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   143
  s>     HTTP/1.1 200 OK\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   144
  s>     Server: testing stub value\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   145
  s>     Date: $HTTP_DATE$\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   146
  s>     Content-Type: application/mercurial-cbor\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   147
  s>     Content-Length: *\r\n (glob)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   148
  s>     \r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37487
diff changeset
   149
  s>     \xa3Dapis\xa1Pexp-http-v2-0001\xa2Hcommands\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\xa1DnameDzlibGapibaseDapi/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
37487
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   150
  sending listkeys command
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   151
  s>     POST /api/exp-http-v2-0001/ro/listkeys HTTP/1.1\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   152
  s>     Accept-Encoding: identity\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   153
  s>     accept: application/mercurial-exp-framing-0003\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   154
  s>     content-type: application/mercurial-exp-framing-0003\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   155
  s>     content-length: 49\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   156
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   157
  s>     user-agent: Mercurial debugwireproto\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   158
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   159
  s>     )\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa1InamespaceIbookmarksDnameHlistkeys
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   160
  s> makefile('rb', None)
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   161
  s>     HTTP/1.1 200 OK\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   162
  s>     Server: testing stub value\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   163
  s>     Date: $HTTP_DATE$\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   164
  s>     Content-Type: application/mercurial-exp-framing-0003\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   165
  s>     Transfer-Encoding: chunked\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   166
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   167
  s>     35\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   168
  s>     -\x00\x00\x01\x00\x02\x01F
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   169
  s>     \xa1A@X(26805aba1e600a82e93661149f2313866a221a7b
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   170
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   171
  received frame(size=45; request=1; stream=2; streamflags=stream-begin; type=bytes-response; flags=eos|cbor)
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   172
  s>     0\r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   173
  s>     \r\n
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   174
  response: [{b'@': b'26805aba1e600a82e93661149f2313866a221a7b'}]
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   175
68915b9f8e96 wireproto: port listkeys commands to wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   176
  $ cat error.log