tests/test-http-protocol.t
author Gregory Szorc <gregory.szorc@gmail.com>
Wed, 12 Sep 2018 10:01:16 -0700
changeset 39646 9c2c77c73f23
parent 39575 07b58266bce3
child 39653 c7a7c7e844e5
permissions -rw-r--r--
wireprotov2: define and implement "changesetdata" command This commit introduces the "changesetdata" wire protocol command. The role of the command is to expose data associated with changelog revisions, including the raw revision data itself. This command is the first piece of a new clone/pull strategy that is built on top of domain-specific commands for data retrieval. Instead of a monolithic "getbundle" command that transfers all of the things, we'll be introducing commands for fetching specific pieces of data. Since the changeset is the fundamental unit from which we derive pointers to other data (manifests, file nodes, etc), it makes sense to start reimplementing pull with this data. The command accepts as arguments a set of root and head revisions defining the changesets that should be fetched as well as an explicit list of nodes. By default, the command returns only the node values: the client must explicitly request additional fields be added to the response. Current supported fields are the list of parent nodes and the revision fulltext. My plan is to eventually add support for transferring other data associated with changesets, including phases, bookmarks, obsolescence markers, etc. Since the response format is CBOR, we'll be able to add this data into the response object relatively easily (it should be as simple as adding a key in a map). The documentation captures a number of TODO items. Some of these may require BC breaking changes. That's fine: wire protocol v2 is still highly experimental. Differential Revision: https://phab.mercurial-scm.org/D4481
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38063
538e850ae737 tests: mark tests that fail when using chg as #require no-chg
Kyle Lippincott <spectral@google.com>
parents: 37832
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: 37832
diff changeset
     2
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
     3
  $ . $TESTDIR/wireprotohelpers.sh
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
     4
30762
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
  $ cat >> $HGRCPATH << EOF
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
  > [web]
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
  > push_ssl = false
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
  > allow_push = *
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
  > EOF
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
  $ hg init server
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
  $ cd server
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
  $ touch a
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
  $ hg -q commit -A -m initial
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
  $ cd ..
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
34483
a6d95a8b7243 serve: make tests compatible with chg
Saurabh Singh <singhsrb@fb.com>
parents: 31028
diff changeset
    17
  $ hg serve -R server -p $HGPORT -d --pid-file hg.pid
30762
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
  $ cat hg.pid >> $DAEMON_PIDS
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
compression formats are advertised in compression capability
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
#if zstd
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
    23
  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zstd,zlib$' > /dev/null
30762
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
#else
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
    25
  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zlib$' > /dev/null
30762
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
#endif
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
  $ killdaemons.py
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
server.compressionengines can replace engines list wholesale
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
34483
a6d95a8b7243 serve: make tests compatible with chg
Saurabh Singh <singhsrb@fb.com>
parents: 31028
diff changeset
    32
  $ hg serve --config server.compressionengines=none -R server -p $HGPORT -d --pid-file hg.pid
30762
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    33
  $ cat hg.pid > $DAEMON_PIDS
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
    34
  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none$' > /dev/null
30762
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    35
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    36
  $ killdaemons.py
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    37
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
Order of engines can also change
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
34483
a6d95a8b7243 serve: make tests compatible with chg
Saurabh Singh <singhsrb@fb.com>
parents: 31028
diff changeset
    40
  $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid
30762
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    41
  $ cat hg.pid > $DAEMON_PIDS
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
    42
  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none,zlib$' > /dev/null
30762
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    43
35b516f800e0 wireproto: advertise supported media types and compression formats
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    44
  $ killdaemons.py
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    45
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    46
Start a default server again
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    47
34483
a6d95a8b7243 serve: make tests compatible with chg
Saurabh Singh <singhsrb@fb.com>
parents: 31028
diff changeset
    48
  $ hg serve -R server -p $HGPORT -d --pid-file hg.pid
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    49
  $ cat hg.pid > $DAEMON_PIDS
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    50
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    51
Server should send application/mercurial-0.1 to clients if no Accept is used
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    52
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
    53
  $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    54
  200 Script output follows
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    55
  content-type: application/mercurial-0.1
37011
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34483
diff changeset
    56
  date: $HTTP_DATE$
37012
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37011
diff changeset
    57
  server: testing stub value
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    58
  transfer-encoding: chunked
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    59
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    60
Server should send application/mercurial-0.1 when client says it wants it
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    61
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
    62
  $ get-with-headers.py --hgproto '0.1' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    63
  200 Script output follows
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    64
  content-type: application/mercurial-0.1
37011
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34483
diff changeset
    65
  date: $HTTP_DATE$
37012
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37011
diff changeset
    66
  server: testing stub value
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    67
  transfer-encoding: chunked
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    68
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    69
Server should send application/mercurial-0.2 when client says it wants it
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    70
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
    71
  $ get-with-headers.py --hgproto '0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    72
  200 Script output follows
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    73
  content-type: application/mercurial-0.2
37011
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34483
diff changeset
    74
  date: $HTTP_DATE$
37012
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37011
diff changeset
    75
  server: testing stub value
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    76
  transfer-encoding: chunked
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    77
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
    78
  $ get-with-headers.py --hgproto '0.1 0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    79
  200 Script output follows
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    80
  content-type: application/mercurial-0.2
37011
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34483
diff changeset
    81
  date: $HTTP_DATE$
37012
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37011
diff changeset
    82
  server: testing stub value
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    83
  transfer-encoding: chunked
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    84
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    85
Requesting a compression format that server doesn't support results will fall back to 0.1
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    86
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
    87
  $ get-with-headers.py --hgproto '0.2 comp=aa' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    88
  200 Script output follows
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    89
  content-type: application/mercurial-0.1
37011
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34483
diff changeset
    90
  date: $HTTP_DATE$
37012
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37011
diff changeset
    91
  server: testing stub value
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    92
  transfer-encoding: chunked
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    93
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    94
#if zstd
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    95
zstd is used if available
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    96
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
    97
  $ get-with-headers.py --hgproto '0.2 comp=zstd' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    98
  $ f --size --hexdump --bytes 36 --sha1 resp
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
    99
  resp: size=248, sha1=4d8d8f87fb82bd542ce52881fdc94f850748
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   100
  0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   101
  0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 7a 73 74 64 |t follows...zstd|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   102
  0020: 28 b5 2f fd                                     |(./.|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   103
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   104
#endif
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   105
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   106
application/mercurial-0.2 is not yet used on non-streaming responses
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   107
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
   108
  $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=heads' -
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   109
  200 Script output follows
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   110
  content-length: 41
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   111
  content-type: application/mercurial-0.1
37011
16203c6079e7 tests: use $HTTP_DATE$ for Date header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 34483
diff changeset
   112
  date: $HTTP_DATE$
37012
5890e5872f36 hgweb: allow defining Server response header for HTTP server
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37011
diff changeset
   113
  server: testing stub value
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   114
  
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   115
  e93700bd72895c5addab234c56d4024b487a362f
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   116
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   117
Now test protocol preference usage
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   118
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   119
  $ killdaemons.py
34483
a6d95a8b7243 serve: make tests compatible with chg
Saurabh Singh <singhsrb@fb.com>
parents: 31028
diff changeset
   120
  $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   121
  $ cat hg.pid > $DAEMON_PIDS
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   122
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   123
No Accept will send 0.1+zlib, even though "none" is preferred b/c "none" isn't supported on 0.1
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   124
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
   125
  $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' Content-Type
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   126
  200 Script output follows
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   127
  content-type: application/mercurial-0.1
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   128
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
   129
  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   130
  $ f --size --hexdump --bytes 28 --sha1 resp
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   131
  resp: size=227, sha1=35a4c074da74f32f5440da3cbf04
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   132
  0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   133
  0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 78             |t follows..x|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   134
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   135
Explicit 0.1 will send zlib because "none" isn't supported on 0.1
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   136
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
   137
  $ get-with-headers.py --hgproto '0.1' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   138
  $ f --size --hexdump --bytes 28 --sha1 resp
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   139
  resp: size=227, sha1=35a4c074da74f32f5440da3cbf04
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   140
  0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   141
  0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 78             |t follows..x|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   142
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   143
0.2 with no compression will get "none" because that is server's preference
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   144
(spec says ZL and UN are implicitly supported)
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   145
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
   146
  $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   147
  $ f --size --hexdump --bytes 32 --sha1 resp
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   148
  resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   149
  0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   150
  0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 6e 6f 6e 65 |t follows...none|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   151
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   152
Client receives server preference even if local order doesn't match
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   153
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
   154
  $ get-with-headers.py --hgproto '0.2 comp=zlib,none' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   155
  $ f --size --hexdump --bytes 32 --sha1 resp
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   156
  resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   157
  0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   158
  0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 6e 6f 6e 65 |t follows...none|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   159
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   160
Client receives only supported format even if not server preferred format
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   161
31028
636cf3f7620d tests: use LOCALIP
Jun Wu <quark@fb.com>
parents: 30852
diff changeset
   162
  $ get-with-headers.py --hgproto '0.2 comp=zlib' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
30764
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   163
  $ f --size --hexdump --bytes 33 --sha1 resp
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   164
  resp: size=232, sha1=a1c727f0c9693ca15742a75c30419bc36
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   165
  0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   166
  0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 7a 6c 69 62 |t follows...zlib|
e75463e3179f protocol: send application/mercurial-0.2 responses to capable clients
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30762
diff changeset
   167
  0020: 78                                              |x|
37015
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   168
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   169
  $ killdaemons.py
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   170
  $ cd ..
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   171
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   172
Test listkeys for listing namespaces
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   173
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   174
  $ hg init empty
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   175
  $ hg -R empty serve -p $HGPORT -d --pid-file hg.pid
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   176
  $ cat hg.pid > $DAEMON_PIDS
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   177
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   178
  $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   179
  > command listkeys
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   180
  >     namespace namespaces
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   181
  > EOF
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   182
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   183
  s>     Accept-Encoding: identity\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   184
  s>     accept: application/mercurial-0.1\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   185
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
37483
61e405fb6372 wireproto: crude support for version 2 HTTP peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37413
diff changeset
   186
  s>     user-agent: Mercurial debugwireproto\r\n
37015
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   187
  s>     \r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   188
  s> makefile('rb', None)
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   189
  s>     HTTP/1.1 200 Script output follows\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   190
  s>     Server: testing stub value\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   191
  s>     Date: $HTTP_DATE$\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   192
  s>     Content-Type: application/mercurial-0.1\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   193
  s>     Content-Length: *\r\n (glob)
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   194
  s>     \r\n
37413
33af46d639b4 wireproto: send server capabilities in canonical order
Joerg Sonnenberger <joerg@bec.de>
parents: 37322
diff changeset
   195
  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
37015
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   196
  sending listkeys command
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   197
  s>     GET /?cmd=listkeys HTTP/1.1\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   198
  s>     Accept-Encoding: identity\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   199
  s>     vary: X-HgArg-1,X-HgProto-1\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   200
  s>     x-hgarg-1: namespace=namespaces\r\n
37498
aacfca6f9767 wireproto: support for pullbundles
Joerg Sonnenberger <joerg@bec.de>
parents: 37483
diff changeset
   201
  s>     x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n
37015
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   202
  s>     accept: application/mercurial-0.1\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   203
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
37483
61e405fb6372 wireproto: crude support for version 2 HTTP peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37413
diff changeset
   204
  s>     user-agent: Mercurial debugwireproto\r\n
37015
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   205
  s>     \r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   206
  s> makefile('rb', None)
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   207
  s>     HTTP/1.1 200 Script output follows\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   208
  s>     Server: testing stub value\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   209
  s>     Date: $HTTP_DATE$\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   210
  s>     Content-Type: application/mercurial-0.1\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   211
  s>     Content-Length: 30\r\n
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   212
  s>     \r\n
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
   213
  s>     bookmarks\t\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
   214
  s>     namespaces\t\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
   215
  s>     phases\t
39405
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   216
  response: {
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   217
    b'bookmarks': b'',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   218
    b'namespaces': b'',
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   219
    b'phases': b''
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   220
  }
37015
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   221
37016
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   222
Same thing, but with "httprequest" command
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   223
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   224
  $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   225
  > httprequest GET ?cmd=listkeys
37048
a708e1e4d7a8 url: support suppressing Accept header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37047
diff changeset
   226
  >     user-agent: test
37016
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   227
  >     x-hgarg-1: namespace=namespaces
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   228
  > EOF
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   229
  using raw connection to peer
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   230
  s>     GET /?cmd=listkeys HTTP/1.1\r\n
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   231
  s>     Accept-Encoding: identity\r\n
37048
a708e1e4d7a8 url: support suppressing Accept header
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37047
diff changeset
   232
  s>     user-agent: test\r\n
37016
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   233
  s>     x-hgarg-1: namespace=namespaces\r\n
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   234
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   235
  s>     \r\n
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   236
  s> makefile('rb', None)
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   237
  s>     HTTP/1.1 200 Script output follows\r\n
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   238
  s>     Server: testing stub value\r\n
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   239
  s>     Date: $HTTP_DATE$\r\n
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   240
  s>     Content-Type: application/mercurial-0.1\r\n
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   241
  s>     Content-Length: 30\r\n
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   242
  s>     \r\n
37322
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
   243
  s>     bookmarks\t\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
   244
  s>     namespaces\t\n
a67fd1fe5109 stringutil: drop escapedata() in favor of escapestr()
Yuya Nishihara <yuya@tcha.org>
parents: 37300
diff changeset
   245
  s>     phases\t
37016
b6a7070e7663 debugcommands: support sending HTTP requests with debugwireproto
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37015
diff changeset
   246
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   247
Client with HTTPv2 enabled advertises that and gets old capabilities response from old server
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   248
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   249
  $ hg --config experimental.httppeer.advertise-v2=true --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   250
  > command heads
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   251
  > EOF
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   252
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   253
  s>     Accept-Encoding: identity\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   254
  s>     vary: X-HgProto-1,X-HgUpgrade-1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   255
  s>     x-hgproto-1: cbor\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   256
  s>     x-hgupgrade-1: exp-http-v2-0001\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   257
  s>     accept: application/mercurial-0.1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   258
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   259
  s>     user-agent: Mercurial debugwireproto\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   260
  s>     \r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   261
  s> makefile('rb', None)
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   262
  s>     HTTP/1.1 200 Script output follows\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   263
  s>     Server: testing stub value\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   264
  s>     Date: $HTTP_DATE$\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   265
  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: 37725
diff changeset
   266
  s>     Content-Length: *\r\n (glob)
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   267
  s>     \r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   268
  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
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   269
  sending heads command
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   270
  s>     GET /?cmd=heads HTTP/1.1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   271
  s>     Accept-Encoding: identity\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   272
  s>     vary: X-HgProto-1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   273
  s>     x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   274
  s>     accept: application/mercurial-0.1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   275
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   276
  s>     user-agent: Mercurial debugwireproto\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   277
  s>     \r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   278
  s> makefile('rb', None)
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   279
  s>     HTTP/1.1 200 Script output follows\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   280
  s>     Server: testing stub value\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   281
  s>     Date: $HTTP_DATE$\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   282
  s>     Content-Type: application/mercurial-0.1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   283
  s>     Content-Length: 41\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   284
  s>     \r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   285
  s>     0000000000000000000000000000000000000000\n
39405
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   286
  response: [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   287
    b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   288
  ]
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   289
37015
fc8939825632 debugcommands: support connecting to HTTP peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37012
diff changeset
   290
  $ killdaemons.py
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   291
  $ enablehttpv2 empty
37822
da07c781aba9 tests: explicitly define compression engines for tests
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37820
diff changeset
   292
  $ hg --config server.compressionengines=zlib -R empty serve -p $HGPORT -d --pid-file hg.pid
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   293
  $ cat hg.pid > $DAEMON_PIDS
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   294
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   295
Client with HTTPv2 enabled automatically upgrades if the server supports it
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   296
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   297
  $ hg --config experimental.httppeer.advertise-v2=true --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   298
  > command heads
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   299
  > EOF
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   300
  s>     GET /?cmd=capabilities HTTP/1.1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   301
  s>     Accept-Encoding: identity\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   302
  s>     vary: X-HgProto-1,X-HgUpgrade-1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   303
  s>     x-hgproto-1: cbor\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   304
  s>     x-hgupgrade-1: exp-http-v2-0001\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   305
  s>     accept: application/mercurial-0.1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   306
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   307
  s>     user-agent: Mercurial debugwireproto\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   308
  s>     \r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   309
  s> makefile('rb', None)
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   310
  s>     HTTP/1.1 200 OK\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   311
  s>     Server: testing stub value\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   312
  s>     Date: $HTTP_DATE$\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   313
  s>     Content-Type: application/mercurial-cbor\r\n
37645
72b0982cd509 debugcommands: perform handshake when obtaining httpv2 peer
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37558
diff changeset
   314
  s>     Content-Length: *\r\n (glob)
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   315
  s>     \r\n
39646
9c2c77c73f23 wireprotov2: define and implement "changesetdata" command
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39575
diff changeset
   316
  s>     \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa8Ibranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1Nv1capabilitiesY\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
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   317
  sending heads command
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   318
  s>     POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   319
  s>     Accept-Encoding: identity\r\n
37725
3ea8323d6f95 wireprotov2: change command response protocol to include a leading map
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37724
diff changeset
   320
  s>     accept: application/mercurial-exp-framing-0005\r\n
3ea8323d6f95 wireprotov2: change command response protocol to include a leading map
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37724
diff changeset
   321
  s>     content-type: application/mercurial-exp-framing-0005\r\n
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   322
  s>     content-length: 20\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   323
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   324
  s>     user-agent: Mercurial debugwireproto\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   325
  s>     \r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   326
  s>     \x0c\x00\x00\x01\x00\x01\x01\x11\xa1DnameEheads
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   327
  s> makefile('rb', None)
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   328
  s>     HTTP/1.1 200 OK\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   329
  s>     Server: testing stub value\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   330
  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
   331
  s>     Content-Type: application/mercurial-exp-framing-0005\r\n
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   332
  s>     Transfer-Encoding: chunked\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   333
  s>     \r\n
39575
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   334
  s>     13\r\n
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   335
  s>     \x0b\x00\x00\x01\x00\x02\x011
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   336
  s>     \xa1FstatusBok
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   337
  s>     \r\n
39575
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   338
  received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation)
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   339
  s>     1e\r\n
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   340
  s>     \x16\x00\x00\x01\x00\x02\x001
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   341
  s>     \x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   342
  s>     \r\n
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   343
  received frame(size=22; request=1; stream=2; streamflags=; type=command-response; flags=continuation)
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   344
  s>     8\r\n
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   345
  s>     \x00\x00\x00\x01\x00\x02\x002
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   346
  s>     \r\n
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   347
  s>     0\r\n
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   348
  s>     \r\n
39575
07b58266bce3 wireprotov2: implement commands as a generator of objects
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39466
diff changeset
   349
  received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos)
39405
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   350
  response: [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   351
    b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   352
  ]
37558
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   353
8a73132214a3 httppeer: support protocol upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37556
diff changeset
   354
  $ killdaemons.py
37832
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   355
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   356
HTTP client follows HTTP redirect on handshake to new repo
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   357
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   358
  $ cd $TESTTMP
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   359
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   360
  $ hg init redirector
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   361
  $ hg init redirected
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   362
  $ cd redirected
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   363
  $ touch foo
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   364
  $ hg -q commit -A -m initial
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   365
  $ cd ..
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   366
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   367
  $ cat > paths.conf << EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   368
  > [paths]
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   369
  > / = $TESTTMP/*
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   370
  > EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   371
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   372
  $ cat > redirectext.py << EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   373
  > from mercurial import extensions, wireprotoserver
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   374
  > def wrappedcallhttp(orig, repo, req, res, proto, cmd):
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   375
  >     path = req.advertisedurl[len(req.advertisedbaseurl):]
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   376
  >     if not path.startswith(b'/redirector'):
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   377
  >         return orig(repo, req, res, proto, cmd)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   378
  >     relpath = path[len(b'/redirector'):]
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   379
  >     res.status = b'301 Redirect'
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   380
  >     newurl = b'%s/redirected%s' % (req.baseurl, relpath)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   381
  >     if not repo.ui.configbool('testing', 'redirectqs', True) and b'?' in newurl:
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   382
  >         newurl = newurl[0:newurl.index(b'?')]
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   383
  >     res.headers[b'Location'] = newurl
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   384
  >     res.headers[b'Content-Type'] = b'text/plain'
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   385
  >     res.setbodybytes(b'redirected')
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   386
  >     return True
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   387
  > 
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   388
  > extensions.wrapfunction(wireprotoserver, '_callhttp', wrappedcallhttp)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   389
  > EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   390
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   391
  $ hg --config extensions.redirect=$TESTTMP/redirectext.py \
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   392
  >    --config server.compressionengines=zlib \
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   393
  >     serve --web-conf paths.conf --pid-file hg.pid -p $HGPORT -d
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   394
  $ cat hg.pid > $DAEMON_PIDS
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   395
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   396
Verify our HTTP 301 is served properly
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   397
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   398
  $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   399
  > httprequest GET /redirector?cmd=capabilities
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   400
  >     user-agent: test
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   401
  > EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   402
  using raw connection to peer
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   403
  s>     GET /redirector?cmd=capabilities HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   404
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   405
  s>     user-agent: test\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   406
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   407
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   408
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   409
  s>     HTTP/1.1 301 Redirect\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   410
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   411
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   412
  s>     Location: http://$LOCALIP:$HGPORT/redirected?cmd=capabilities\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   413
  s>     Content-Type: text/plain\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   414
  s>     Content-Length: 10\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   415
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   416
  s>     redirected
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   417
  s>     GET /redirected?cmd=capabilities HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   418
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   419
  s>     user-agent: test\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   420
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   421
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   422
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   423
  s>     HTTP/1.1 200 Script output follows\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   424
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   425
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   426
  s>     Content-Type: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   427
  s>     Content-Length: 453\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   428
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   429
  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
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   430
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   431
Test with the HTTP peer
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   432
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   433
  $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT/redirector << EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   434
  > command heads
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   435
  > EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   436
  s>     GET /redirector?cmd=capabilities HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   437
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   438
  s>     accept: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   439
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   440
  s>     user-agent: Mercurial debugwireproto\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   441
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   442
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   443
  s>     HTTP/1.1 301 Redirect\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   444
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   445
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   446
  s>     Location: http://$LOCALIP:$HGPORT/redirected?cmd=capabilities\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   447
  s>     Content-Type: text/plain\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   448
  s>     Content-Length: 10\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   449
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   450
  s>     redirected
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   451
  s>     GET /redirected?cmd=capabilities HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   452
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   453
  s>     accept: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   454
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   455
  s>     user-agent: Mercurial debugwireproto\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   456
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   457
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   458
  s>     HTTP/1.1 200 Script output follows\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   459
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   460
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   461
  s>     Content-Type: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   462
  s>     Content-Length: 453\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   463
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   464
  real URL is http://$LOCALIP:$HGPORT/redirected (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   465
  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
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   466
  sending heads command
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   467
  s>     GET /redirected?cmd=heads HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   468
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   469
  s>     vary: X-HgProto-1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   470
  s>     x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   471
  s>     accept: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   472
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   473
  s>     user-agent: Mercurial debugwireproto\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   474
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   475
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   476
  s>     HTTP/1.1 200 Script output follows\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   477
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   478
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   479
  s>     Content-Type: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   480
  s>     Content-Length: 41\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   481
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   482
  s>     96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n
39405
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   483
  response: [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   484
    b'\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   485
  ]
37832
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   486
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   487
  $ killdaemons.py
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   488
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   489
Now test a variation where we strip the query string from the redirect URL.
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   490
(SCM Manager apparently did this and clients would recover from it)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   491
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   492
  $ hg --config extensions.redirect=$TESTTMP/redirectext.py \
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   493
  >    --config server.compressionengines=zlib \
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   494
  >    --config testing.redirectqs=false \
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   495
  >     serve --web-conf paths.conf --pid-file hg.pid -p $HGPORT -d
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   496
  $ cat hg.pid > $DAEMON_PIDS
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   497
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   498
  $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   499
  > httprequest GET /redirector?cmd=capabilities
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   500
  >     user-agent: test
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   501
  > EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   502
  using raw connection to peer
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   503
  s>     GET /redirector?cmd=capabilities HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   504
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   505
  s>     user-agent: test\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   506
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   507
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   508
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   509
  s>     HTTP/1.1 301 Redirect\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   510
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   511
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   512
  s>     Location: http://$LOCALIP:$HGPORT/redirected\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   513
  s>     Content-Type: text/plain\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   514
  s>     Content-Length: 10\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   515
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   516
  s>     redirected
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   517
  s>     GET /redirected HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   518
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   519
  s>     user-agent: test\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   520
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   521
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   522
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   523
  s>     HTTP/1.1 200 Script output follows\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   524
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   525
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   526
  s>     ETag: W/"*"\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   527
  s>     Content-Type: text/html; charset=ascii\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   528
  s>     Transfer-Encoding: chunked\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   529
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   530
  s>     414\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   531
  s>     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   532
  s>     <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   533
  s>     <head>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   534
  s>     <link rel="icon" href="/redirected/static/hgicon.png" type="image/png" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   535
  s>     <meta name="robots" content="index, nofollow" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   536
  s>     <link rel="stylesheet" href="/redirected/static/style-paper.css" type="text/css" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   537
  s>     <script type="text/javascript" src="/redirected/static/mercurial.js"></script>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   538
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   539
  s>     <title>redirected: log</title>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   540
  s>     <link rel="alternate" type="application/atom+xml"\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   541
  s>        href="/redirected/atom-log" title="Atom feed for redirected" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   542
  s>     <link rel="alternate" type="application/rss+xml"\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   543
  s>        href="/redirected/rss-log" title="RSS feed for redirected" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   544
  s>     </head>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   545
  s>     <body>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   546
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   547
  s>     <div class="container">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   548
  s>     <div class="menu">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   549
  s>     <div class="logo">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   550
  s>     <a href="https://mercurial-scm.org/">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   551
  s>     <img src="/redirected/static/hglogo.png" alt="mercurial" /></a>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   552
  s>     </div>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   553
  s>     <ul>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   554
  s>     <li class="active">log</li>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   555
  s>     <li><a href="/redirected/graph/tip">graph</a></li>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   556
  s>     <li><a href="/redirected/tags">tags</a></li>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   557
  s>     <li><a href="
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   558
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   559
  s>     810\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   560
  s>     /redirected/bookmarks">bookmarks</a></li>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   561
  s>     <li><a href="/redirected/branches">branches</a></li>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   562
  s>     </ul>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   563
  s>     <ul>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   564
  s>     <li><a href="/redirected/rev/tip">changeset</a></li>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   565
  s>     <li><a href="/redirected/file/tip">browse</a></li>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   566
  s>     </ul>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   567
  s>     <ul>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   568
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   569
  s>     </ul>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   570
  s>     <ul>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   571
  s>      <li><a href="/redirected/help">help</a></li>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   572
  s>     </ul>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   573
  s>     <div class="atom-logo">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   574
  s>     <a href="/redirected/atom-log" title="subscribe to atom feed">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   575
  s>     <img class="atom-logo" src="/redirected/static/feed-icon-14x14.png" alt="atom feed" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   576
  s>     </a>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   577
  s>     </div>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   578
  s>     </div>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   579
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   580
  s>     <div class="main">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   581
  s>     <h2 class="breadcrumb"><a href="/">Mercurial</a> &gt; <a href="/redirected">redirected</a> </h2>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   582
  s>     <h3>log</h3>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   583
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   584
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   585
  s>     <form class="search" action="/redirected/log">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   586
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   587
  s>     <p><input name="rev" id="search1" type="text" size="30" value="" /></p>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   588
  s>     <div id="hint">Find changesets by keywords (author, files, the commit message), revision\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   589
  s>     number or hash, or <a href="/redirected/help/revsets">revset expression</a>.</div>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   590
  s>     </form>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   591
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   592
  s>     <div class="navigate">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   593
  s>     <a href="/redirected/shortlog/tip?revcount=30">less</a>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   594
  s>     <a href="/redirected/shortlog/tip?revcount=120">more</a>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   595
  s>     | rev 0: <a href="/redirected/shortlog/96ee1d7354c4">(0)</a> <a href="/redirected/shortlog/tip">tip</a> \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   596
  s>     </div>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   597
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   598
  s>     <table class="bigtable">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   599
  s>     <thead>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   600
  s>      <tr>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   601
  s>       <th class="age">age</th>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   602
  s>       <th class="author">author</th>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   603
  s>       <th class="description">description</th>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   604
  s>      </tr>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   605
  s>     </thead>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   606
  s>     <tbody class="stripes2">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   607
  s>      <tr>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   608
  s>       <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   609
  s>       <td class="author">test</td>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   610
  s>       <td class="description">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   611
  s>        <a href="/redirected/rev/96ee1d7354c4">initial</a>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   612
  s>        <span class="phase">draft</span> <span class="branchhead">default</span> <span class="tag">tip</span> \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   613
  s>       </td>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   614
  s>      </tr>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   615
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   616
  s>     </tbody>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   617
  s>     </table>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   618
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   619
  s>     <div class="navigate">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   620
  s>     <a href="/redirected/shortlog/tip?revcount=30">less</a>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   621
  s>     <a href="/redirected/shortlog/tip?revcount=120">more</a>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   622
  s>     | rev 0: <a href="/redirected/shortlog/96ee1d7354c4">(0)</a> <a href="/redirected/shortlog/tip">tip</a> \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   623
  s>     </div>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   624
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   625
  s>     <script type="text/javascript">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   626
  s>         ajaxScrollInit(\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   627
  s>                 \'/redirected/shortlog/%next%\',\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   628
  s>                 \'\', <!-- NEXTHASH\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   629
  s>                 function (htmlText) {
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   630
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   631
  s>     14a\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   632
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   633
  s>                     var m = htmlText.match(/\'(\\w+)\', <!-- NEXTHASH/);\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   634
  s>                     return m ? m[1] : null;\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   635
  s>                 },\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   636
  s>                 \'.bigtable > tbody\',\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   637
  s>                 \'<tr class="%class%">\\\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   638
  s>                 <td colspan="3" style="text-align: center;">%text%</td>\\\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   639
  s>                 </tr>\'\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   640
  s>         );\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   641
  s>     </script>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   642
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   643
  s>     </div>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   644
  s>     </div>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   645
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   646
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   647
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   648
  s>     </body>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   649
  s>     </html>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   650
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   651
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   652
  s>     0\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   653
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   654
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   655
  $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT/redirector << EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   656
  > command heads
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   657
  > EOF
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   658
  s>     GET /redirector?cmd=capabilities HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   659
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   660
  s>     accept: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   661
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   662
  s>     user-agent: Mercurial debugwireproto\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   663
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   664
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   665
  s>     HTTP/1.1 301 Redirect\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   666
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   667
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   668
  s>     Location: http://$LOCALIP:$HGPORT/redirected\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   669
  s>     Content-Type: text/plain\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   670
  s>     Content-Length: 10\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   671
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   672
  s>     redirected
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   673
  s>     GET /redirected HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   674
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   675
  s>     accept: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   676
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   677
  s>     user-agent: Mercurial debugwireproto\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   678
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   679
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   680
  s>     HTTP/1.1 200 Script output follows\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   681
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   682
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   683
  s>     ETag: W/"*"\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   684
  s>     Content-Type: text/html; charset=ascii\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   685
  s>     Transfer-Encoding: chunked\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   686
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   687
  real URL is http://$LOCALIP:$HGPORT/redirected (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   688
  s>     414\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   689
  s>     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   690
  s>     <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   691
  s>     <head>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   692
  s>     <link rel="icon" href="/redirected/static/hgicon.png" type="image/png" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   693
  s>     <meta name="robots" content="index, nofollow" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   694
  s>     <link rel="stylesheet" href="/redirected/static/style-paper.css" type="text/css" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   695
  s>     <script type="text/javascript" src="/redirected/static/mercurial.js"></script>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   696
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   697
  s>     <title>redirected: log</title>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   698
  s>     <link rel="alternate" type="application/atom+xml"\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   699
  s>        href="/redirected/atom-log" title="Atom feed for redirected" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   700
  s>     <link rel="alternate" type="application/rss+xml"\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   701
  s>        href="/redirected/rss-log" title="RSS feed for redirected" />\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   702
  s>     </head>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   703
  s>     <body>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   704
  s>     \n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   705
  s>     <div class="container">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   706
  s>     <div class="menu">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   707
  s>     <div class="logo">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   708
  s>     <a href="https://mercurial-scm.org/">\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   709
  s>     <img src="/redirected/static/hglogo.png" alt="mercurial" /></a>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   710
  s>     </div>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   711
  s>     <ul>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   712
  s>     <li class="active">log</li>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   713
  s>     <li><a href="/redirected/graph/tip">graph</a></li>\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   714
  s>     <li><a href="/redirected/tags">tags</a
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   715
  s>     GET /redirected?cmd=capabilities HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   716
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   717
  s>     accept: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   718
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   719
  s>     user-agent: Mercurial debugwireproto\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   720
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   721
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   722
  s>     HTTP/1.1 200 Script output follows\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   723
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   724
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   725
  s>     Content-Type: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   726
  s>     Content-Length: 453\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   727
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   728
  real URL is http://$LOCALIP:$HGPORT/redirected (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   729
  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
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   730
  sending heads command
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   731
  s>     GET /redirected?cmd=heads HTTP/1.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   732
  s>     Accept-Encoding: identity\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   733
  s>     vary: X-HgProto-1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   734
  s>     x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   735
  s>     accept: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   736
  s>     host: $LOCALIP:$HGPORT\r\n (glob)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   737
  s>     user-agent: Mercurial debugwireproto\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   738
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   739
  s> makefile('rb', None)
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   740
  s>     HTTP/1.1 200 Script output follows\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   741
  s>     Server: testing stub value\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   742
  s>     Date: $HTTP_DATE$\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   743
  s>     Content-Type: application/mercurial-0.1\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   744
  s>     Content-Length: 41\r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   745
  s>     \r\n
6169d95dce3b httppeer: detect redirect to URL without query string (issue5860)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37822
diff changeset
   746
  s>     96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n
39405
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   747
  response: [
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   748
    b'\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL'
0f549da54379 stringutil: teach pprint() to indent
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38063
diff changeset
   749
  ]