tests/test-wireproto-command-capabilities.t
author Pulkit Goyal <pulkit@yandex-team.ru>
Mon, 03 Sep 2018 13:56:53 +0300
changeset 39408 c7f213d7f4d2
parent 39378 0f549da54379
child 39447 5f4a9ada5ab5
permissions -rw-r--r--
py3: add new passing test to whitelist found by buildbot Differential Revision: https://phab.mercurial-scm.org/D4451
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38021
538e850ae737 tests: mark tests that fail when using chg as #require no-chg
Kyle Lippincott <spectral@google.com>
parents: 37822
diff changeset
     1
#require no-chg
538e850ae737 tests: mark tests that fail when using chg as #require no-chg
Kyle Lippincott <spectral@google.com>
parents: 37822
diff changeset
     2
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
  $ . $TESTDIR/wireprotohelpers.sh
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
  $ hg init server
37822
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
     6
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
     7
zstd isn't present in plain builds. Make tests easier by removing
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
     8
zstd from the equation.
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
     9
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
    10
  $ cat >> server/.hg/hgrc << EOF
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
    11
  > [server]
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
    12
  > compressionengines = zlib
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
    13
  > EOF
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
    14
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    15
  $ hg -R server serve -p $HGPORT -d --pid-file hg.pid -E error.log
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    16
  $ cat hg.pid > $DAEMON_PIDS
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    17
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    18
A normal capabilities request is serviced for version 1
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    19
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    20
  $ sendhttpraw << EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    21
  > httprequest GET ?cmd=capabilities
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    22
  >     user-agent: test
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    23
  > EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    24
  using raw connection to peer
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    25
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    26
  s>     Accept-Encoding: identity\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    27
  s>     user-agent: test\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    28
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    29
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    30
  s> makefile('rb', None)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    31
  s>     HTTP/1.1 200 Script output follows\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    32
  s>     Server: testing stub value\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    33
  s>     Date: $HTTP_DATE$\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    34
  s>     Content-Type: application/mercurial-0.1\r\n
37820
143632f82479 tests: glob away content-length changes relating to missing zstd bindings
Augie Fackler <augie@google.com>
parents: 37761
diff changeset
    35
  s>     Content-Length: *\r\n (glob)
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    36
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    37
  s>     batch 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
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    38
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    39
A proper request without the API server enabled returns the legacy response
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    40
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    41
  $ sendhttpraw << EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    42
  > httprequest GET ?cmd=capabilities
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    43
  >    user-agent: test
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    44
  >    x-hgupgrade-1: foo
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    45
  >    x-hgproto-1: cbor
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    46
  > EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    47
  using raw connection to peer
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    48
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    49
  s>     Accept-Encoding: identity\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    50
  s>     user-agent: test\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    51
  s>     x-hgproto-1: cbor\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    52
  s>     x-hgupgrade-1: foo\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    53
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    54
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    55
  s> makefile('rb', None)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    56
  s>     HTTP/1.1 200 Script output follows\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    57
  s>     Server: testing stub value\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    58
  s>     Date: $HTTP_DATE$\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    59
  s>     Content-Type: application/mercurial-0.1\r\n
37820
143632f82479 tests: glob away content-length changes relating to missing zstd bindings
Augie Fackler <augie@google.com>
parents: 37761
diff changeset
    60
  s>     Content-Length: *\r\n (glob)
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    61
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    62
  s>     batch 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
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    63
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    64
Restart with just API server enabled. This enables serving the new format.
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    65
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    66
  $ killdaemons.py
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    67
  $ cat error.log
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    68
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    69
  $ cat >> server/.hg/hgrc << EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    70
  > [experimental]
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    71
  > web.apiserver = true
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    72
  > EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    73
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    74
  $ hg -R server serve -p $HGPORT -d --pid-file hg.pid -E error.log
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
  $ cat hg.pid > $DAEMON_PIDS
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    76
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    77
X-HgUpgrade-<N> without CBOR advertisement uses legacy response
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    78
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    79
  $ sendhttpraw << EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    80
  > httprequest GET ?cmd=capabilities
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    81
  >    user-agent: test
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    82
  >    x-hgupgrade-1: foo bar
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    83
  > EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    84
  using raw connection to peer
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    85
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    86
  s>     Accept-Encoding: identity\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    87
  s>     user-agent: test\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    88
  s>     x-hgupgrade-1: foo bar\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    89
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    90
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    91
  s> makefile('rb', None)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    92
  s>     HTTP/1.1 200 Script output follows\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    93
  s>     Server: testing stub value\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    94
  s>     Date: $HTTP_DATE$\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    95
  s>     Content-Type: application/mercurial-0.1\r\n
37820
143632f82479 tests: glob away content-length changes relating to missing zstd bindings
Augie Fackler <augie@google.com>
parents: 37761
diff changeset
    96
  s>     Content-Length: *\r\n (glob)
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    97
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    98
  s>     batch 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
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
    99
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   100
X-HgUpgrade-<N> without known serialization in X-HgProto-<N> uses legacy response
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   101
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   102
  $ sendhttpraw << EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   103
  > httprequest GET ?cmd=capabilities
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   104
  >    user-agent: test
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   105
  >    x-hgupgrade-1: foo bar
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   106
  >    x-hgproto-1: some value
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   107
  > EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   108
  using raw connection to peer
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   109
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   110
  s>     Accept-Encoding: identity\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   111
  s>     user-agent: test\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   112
  s>     x-hgproto-1: some value\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   113
  s>     x-hgupgrade-1: foo bar\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   114
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   115
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   116
  s> makefile('rb', None)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   117
  s>     HTTP/1.1 200 Script output follows\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   118
  s>     Server: testing stub value\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   119
  s>     Date: $HTTP_DATE$\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   120
  s>     Content-Type: application/mercurial-0.1\r\n
37820
143632f82479 tests: glob away content-length changes relating to missing zstd bindings
Augie Fackler <augie@google.com>
parents: 37761
diff changeset
   121
  s>     Content-Length: *\r\n (glob)
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   122
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   123
  s>     batch 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
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   124
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   125
X-HgUpgrade-<N> + X-HgProto-<N> headers trigger new response format
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   126
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   127
  $ sendhttpraw << EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   128
  > httprequest GET ?cmd=capabilities
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   129
  >    user-agent: test
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   130
  >    x-hgupgrade-1: foo bar
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   131
  >    x-hgproto-1: cbor
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   132
  > EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   133
  using raw connection to peer
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   134
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   135
  s>     Accept-Encoding: identity\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   136
  s>     user-agent: test\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   137
  s>     x-hgproto-1: cbor\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   138
  s>     x-hgupgrade-1: foo bar\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   139
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   140
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   141
  s> makefile('rb', None)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   142
  s>     HTTP/1.1 200 OK\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   143
  s>     Server: testing stub value\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   144
  s>     Date: $HTTP_DATE$\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   145
  s>     Content-Type: application/mercurial-cbor\r\n
37820
143632f82479 tests: glob away content-length changes relating to missing zstd bindings
Augie Fackler <augie@google.com>
parents: 37761
diff changeset
   146
  s>     Content-Length: *\r\n (glob)
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   147
  s>     \r\n
37822
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
   148
  s>     \xa3Dapis\xa0GapibaseDapi/Nv1capabilitiesY\x01\xc5batch 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
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   149
  cbor> {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   150
    b'apibase': b'api/',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   151
    b'apis': {},
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   152
    b'v1capabilities': b'batch 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'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   153
  }
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   154
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   155
Restart server to enable HTTPv2
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   156
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   157
  $ killdaemons.py
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   158
  $ enablehttpv2 server
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   159
  $ hg -R server serve -p $HGPORT -d --pid-file hg.pid -E error.log
37761
ff6b0a20849d tests: arrange for a server in wireproto-command-capabilities.t to be killed
Matt Harbison <matt_harbison@yahoo.com>
parents: 37725
diff changeset
   160
  $ cat hg.pid > $DAEMON_PIDS
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   161
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   162
Only requested API services are returned
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   163
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   164
  $ sendhttpraw << EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   165
  > httprequest GET ?cmd=capabilities
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   166
  >    user-agent: test
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   167
  >    x-hgupgrade-1: foo bar
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   168
  >    x-hgproto-1: cbor
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   169
  > EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   170
  using raw connection to peer
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   171
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   172
  s>     Accept-Encoding: identity\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   173
  s>     user-agent: test\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   174
  s>     x-hgproto-1: cbor\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   175
  s>     x-hgupgrade-1: foo bar\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   176
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   177
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   178
  s> makefile('rb', None)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   179
  s>     HTTP/1.1 200 OK\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   180
  s>     Server: testing stub value\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   181
  s>     Date: $HTTP_DATE$\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   182
  s>     Content-Type: application/mercurial-cbor\r\n
37820
143632f82479 tests: glob away content-length changes relating to missing zstd bindings
Augie Fackler <augie@google.com>
parents: 37761
diff changeset
   183
  s>     Content-Length: *\r\n (glob)
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   184
  s>     \r\n
37822
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
   185
  s>     \xa3Dapis\xa0GapibaseDapi/Nv1capabilitiesY\x01\xc5batch 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
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   186
  cbor> {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   187
    b'apibase': b'api/',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   188
    b'apis': {},
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   189
    b'v1capabilities': b'batch 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'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   190
  }
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   191
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   192
Request for HTTPv2 service returns information about it
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   193
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   194
  $ sendhttpraw << EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   195
  > httprequest GET ?cmd=capabilities
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   196
  >    user-agent: test
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   197
  >    x-hgupgrade-1: exp-http-v2-0001 foo bar
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   198
  >    x-hgproto-1: cbor
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   199
  > EOF
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   200
  using raw connection to peer
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   201
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   202
  s>     Accept-Encoding: identity\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   203
  s>     user-agent: test\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   204
  s>     x-hgproto-1: cbor\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   205
  s>     x-hgupgrade-1: exp-http-v2-0001 foo bar\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   206
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   207
  s>     \r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   208
  s> makefile('rb', None)
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   209
  s>     HTTP/1.1 200 OK\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   210
  s>     Server: testing stub value\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   211
  s>     Date: $HTTP_DATE$\r\n
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   212
  s>     Content-Type: application/mercurial-cbor\r\n
37645
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   213
  s>     Content-Length: *\r\n (glob)
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   214
  s>     \r\n
37822
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
   215
  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\x81\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005GapibaseDapi/Nv1capabilitiesY\x01\xc5batch 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
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   216
  cbor> {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   217
    b'apibase': b'api/',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   218
    b'apis': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   219
      b'exp-http-v2-0001': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   220
        b'commands': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   221
          b'branchmap': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   222
            b'args': {},
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   223
            b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   224
              b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   225
            ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   226
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   227
          b'capabilities': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   228
            b'args': {},
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   229
            b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   230
              b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   231
            ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   232
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   233
          b'heads': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   234
            b'args': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   235
              b'publiconly': False
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   236
            },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   237
            b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   238
              b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   239
            ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   240
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   241
          b'known': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   242
            b'args': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   243
              b'nodes': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   244
                b'deadbeef'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   245
              ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   246
            },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   247
            b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   248
              b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   249
            ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   250
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   251
          b'listkeys': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   252
            b'args': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   253
              b'namespace': b'ns'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   254
            },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   255
            b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   256
              b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   257
            ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   258
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   259
          b'lookup': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   260
            b'args': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   261
              b'key': b'foo'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   262
            },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   263
            b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   264
              b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   265
            ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   266
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   267
          b'pushkey': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   268
            b'args': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   269
              b'key': b'key',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   270
              b'namespace': b'ns',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   271
              b'new': b'new',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   272
              b'old': b'old'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   273
            },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   274
            b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   275
              b'push'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   276
            ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   277
          }
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   278
        },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   279
        b'compression': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   280
          {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   281
            b'name': b'zlib'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   282
          }
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   283
        ],
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   284
        b'framingmediatypes': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   285
          b'application/mercurial-exp-framing-0005'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   286
        ],
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   287
        b'rawrepoformats': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   288
          b'generaldelta',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   289
          b'revlogv1'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   290
        ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   291
      }
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   292
    },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   293
    b'v1capabilities': b'batch 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'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   294
  }
37557
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   295
734515aca84d wireproto: define and implement HTTP handshake to upgrade protocol
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37539
diff changeset
   296
capabilities command returns expected info
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   297
37718
ad1c07008e0b debugcommands: ability to suppress logging of handshake
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37657
diff changeset
   298
  $ sendhttpv2peerhandshake << EOF
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   299
  > command capabilities
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   300
  > EOF
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   301
  creating http peer for wire protocol version 2
37718
ad1c07008e0b debugcommands: ability to suppress logging of handshake
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37657
diff changeset
   302
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
37645
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   303
  s>     Accept-Encoding: identity\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   304
  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: 37557
diff changeset
   305
  s>     x-hgproto-1: cbor\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   306
  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: 37557
diff changeset
   307
  s>     accept: application/mercurial-0.1\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   308
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   309
  s>     user-agent: Mercurial debugwireproto\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   310
  s>     \r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   311
  s> makefile('rb', None)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   312
  s>     HTTP/1.1 200 OK\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   313
  s>     Server: testing stub value\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   314
  s>     Date: $HTTP_DATE$\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   315
  s>     Content-Type: application/mercurial-cbor\r\n
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   316
  s>     Content-Length: *\r\n (glob)
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37557
diff changeset
   317
  s>     \r\n
37822
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
   318
  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\x81\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005GapibaseDapi/Nv1capabilitiesY\x01\xc5batch 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
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   319
  sending capabilities command
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   320
  s>     POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   321
  s>     Accept-Encoding: identity\r\n
37722
89a16704114c wireprotov2: define response data as CBOR
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37718
diff changeset
   322
  s>     *\r\n (glob)
37725
3ea8323d6f95 wireprotov2: change command response protocol to include a leading map
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37724
diff changeset
   323
  s>     content-type: application/mercurial-exp-framing-0005\r\n
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   324
  s>     content-length: 27\r\n
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   325
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   326
  s>     user-agent: Mercurial debugwireproto\r\n
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   327
  s>     \r\n
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   328
  s>     \x13\x00\x00\x01\x00\x01\x01\x11\xa1DnameLcapabilities
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   329
  s> makefile('rb', None)
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   330
  s>     HTTP/1.1 200 OK\r\n
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   331
  s>     Server: testing stub value\r\n
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   332
  s>     Date: $HTTP_DATE$\r\n
37725
3ea8323d6f95 wireprotov2: change command response protocol to include a leading map
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37724
diff changeset
   333
  s>     Content-Type: application/mercurial-exp-framing-0005\r\n
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   334
  s>     Transfer-Encoding: chunked\r\n
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   335
  s>     \r\n
37822
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
   336
  s>     1d7\r\n
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
   337
  s>     \xcf\x01\x00\x01\x00\x02\x012
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
   338
  s>     \xa1FstatusBok\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\x81\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   339
  s>     \r\n
37822
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
   340
  received frame(size=463; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos)
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   341
  s>     0\r\n
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   342
  s>     \r\n
39378
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   343
  response: [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   344
    {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   345
      b'status': b'ok'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   346
    },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   347
    {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   348
      b'commands': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   349
        b'branchmap': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   350
          b'args': {},
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   351
          b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   352
            b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   353
          ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   354
        },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   355
        b'capabilities': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   356
          b'args': {},
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   357
          b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   358
            b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   359
          ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   360
        },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   361
        b'heads': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   362
          b'args': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   363
            b'publiconly': False
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   364
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   365
          b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   366
            b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   367
          ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   368
        },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   369
        b'known': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   370
          b'args': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   371
            b'nodes': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   372
              b'deadbeef'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   373
            ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   374
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   375
          b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   376
            b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   377
          ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   378
        },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   379
        b'listkeys': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   380
          b'args': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   381
            b'namespace': b'ns'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   382
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   383
          b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   384
            b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   385
          ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   386
        },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   387
        b'lookup': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   388
          b'args': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   389
            b'key': b'foo'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   390
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   391
          b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   392
            b'pull'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   393
          ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   394
        },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   395
        b'pushkey': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   396
          b'args': {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   397
            b'key': b'key',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   398
            b'namespace': b'ns',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   399
            b'new': b'new',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   400
            b'old': b'old'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   401
          },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   402
          b'permissions': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   403
            b'push'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   404
          ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   405
        }
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   406
      },
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   407
      b'compression': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   408
        {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   409
          b'name': b'zlib'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   410
        }
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   411
      ],
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   412
      b'framingmediatypes': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   413
        b'application/mercurial-exp-framing-0005'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   414
      ],
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   415
      b'rawrepoformats': [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   416
        b'generaldelta',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   417
        b'revlogv1'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   418
      ]
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   419
    }
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38021
diff changeset
   420
  ]
37533
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   421
df4985497986 wireproto: implement capabilities for wire protocol v2
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   422
  $ cat error.log