Show More
@@ -1,335 +1,335 b'' | |||||
1 | $ . $TESTDIR/wireprotohelpers.sh |
|
1 | $ . $TESTDIR/wireprotohelpers.sh | |
2 |
|
2 | |||
3 | $ cat >> $HGRCPATH << EOF |
|
3 | $ cat >> $HGRCPATH << EOF | |
4 | > [web] |
|
4 | > [web] | |
5 | > push_ssl = false |
|
5 | > push_ssl = false | |
6 | > allow_push = * |
|
6 | > allow_push = * | |
7 | > EOF |
|
7 | > EOF | |
8 |
|
8 | |||
9 | $ hg init server |
|
9 | $ hg init server | |
10 | $ cd server |
|
10 | $ cd server | |
11 | $ touch a |
|
11 | $ touch a | |
12 | $ hg -q commit -A -m initial |
|
12 | $ hg -q commit -A -m initial | |
13 | $ cd .. |
|
13 | $ cd .. | |
14 |
|
14 | |||
15 | $ hg serve -R server -p $HGPORT -d --pid-file hg.pid |
|
15 | $ hg serve -R server -p $HGPORT -d --pid-file hg.pid | |
16 | $ cat hg.pid >> $DAEMON_PIDS |
|
16 | $ cat hg.pid >> $DAEMON_PIDS | |
17 |
|
17 | |||
18 | compression formats are advertised in compression capability |
|
18 | compression formats are advertised in compression capability | |
19 |
|
19 | |||
20 | #if zstd |
|
20 | #if zstd | |
21 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zstd,zlib$' > /dev/null |
|
21 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zstd,zlib$' > /dev/null | |
22 | #else |
|
22 | #else | |
23 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zlib$' > /dev/null |
|
23 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zlib$' > /dev/null | |
24 | #endif |
|
24 | #endif | |
25 |
|
25 | |||
26 | $ killdaemons.py |
|
26 | $ killdaemons.py | |
27 |
|
27 | |||
28 | server.compressionengines can replace engines list wholesale |
|
28 | server.compressionengines can replace engines list wholesale | |
29 |
|
29 | |||
30 | $ hg serve --config server.compressionengines=none -R server -p $HGPORT -d --pid-file hg.pid |
|
30 | $ hg serve --config server.compressionengines=none -R server -p $HGPORT -d --pid-file hg.pid | |
31 | $ cat hg.pid > $DAEMON_PIDS |
|
31 | $ cat hg.pid > $DAEMON_PIDS | |
32 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none$' > /dev/null |
|
32 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none$' > /dev/null | |
33 |
|
33 | |||
34 | $ killdaemons.py |
|
34 | $ killdaemons.py | |
35 |
|
35 | |||
36 | Order of engines can also change |
|
36 | Order of engines can also change | |
37 |
|
37 | |||
38 | $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid |
|
38 | $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid | |
39 | $ cat hg.pid > $DAEMON_PIDS |
|
39 | $ cat hg.pid > $DAEMON_PIDS | |
40 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none,zlib$' > /dev/null |
|
40 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none,zlib$' > /dev/null | |
41 |
|
41 | |||
42 | $ killdaemons.py |
|
42 | $ killdaemons.py | |
43 |
|
43 | |||
44 | Start a default server again |
|
44 | Start a default server again | |
45 |
|
45 | |||
46 | $ hg serve -R server -p $HGPORT -d --pid-file hg.pid |
|
46 | $ hg serve -R server -p $HGPORT -d --pid-file hg.pid | |
47 | $ cat hg.pid > $DAEMON_PIDS |
|
47 | $ cat hg.pid > $DAEMON_PIDS | |
48 |
|
48 | |||
49 | Server should send application/mercurial-0.1 to clients if no Accept is used |
|
49 | Server should send application/mercurial-0.1 to clients if no Accept is used | |
50 |
|
50 | |||
51 | $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - |
|
51 | $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - | |
52 | 200 Script output follows |
|
52 | 200 Script output follows | |
53 | content-type: application/mercurial-0.1 |
|
53 | content-type: application/mercurial-0.1 | |
54 | date: $HTTP_DATE$ |
|
54 | date: $HTTP_DATE$ | |
55 | server: testing stub value |
|
55 | server: testing stub value | |
56 | transfer-encoding: chunked |
|
56 | transfer-encoding: chunked | |
57 |
|
57 | |||
58 | Server should send application/mercurial-0.1 when client says it wants it |
|
58 | Server should send application/mercurial-0.1 when client says it wants it | |
59 |
|
59 | |||
60 | $ get-with-headers.py --hgproto '0.1' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - |
|
60 | $ get-with-headers.py --hgproto '0.1' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - | |
61 | 200 Script output follows |
|
61 | 200 Script output follows | |
62 | content-type: application/mercurial-0.1 |
|
62 | content-type: application/mercurial-0.1 | |
63 | date: $HTTP_DATE$ |
|
63 | date: $HTTP_DATE$ | |
64 | server: testing stub value |
|
64 | server: testing stub value | |
65 | transfer-encoding: chunked |
|
65 | transfer-encoding: chunked | |
66 |
|
66 | |||
67 | Server should send application/mercurial-0.2 when client says it wants it |
|
67 | Server should send application/mercurial-0.2 when client says it wants it | |
68 |
|
68 | |||
69 | $ get-with-headers.py --hgproto '0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - |
|
69 | $ get-with-headers.py --hgproto '0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - | |
70 | 200 Script output follows |
|
70 | 200 Script output follows | |
71 | content-type: application/mercurial-0.2 |
|
71 | content-type: application/mercurial-0.2 | |
72 | date: $HTTP_DATE$ |
|
72 | date: $HTTP_DATE$ | |
73 | server: testing stub value |
|
73 | server: testing stub value | |
74 | transfer-encoding: chunked |
|
74 | transfer-encoding: chunked | |
75 |
|
75 | |||
76 | $ get-with-headers.py --hgproto '0.1 0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - |
|
76 | $ get-with-headers.py --hgproto '0.1 0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - | |
77 | 200 Script output follows |
|
77 | 200 Script output follows | |
78 | content-type: application/mercurial-0.2 |
|
78 | content-type: application/mercurial-0.2 | |
79 | date: $HTTP_DATE$ |
|
79 | date: $HTTP_DATE$ | |
80 | server: testing stub value |
|
80 | server: testing stub value | |
81 | transfer-encoding: chunked |
|
81 | transfer-encoding: chunked | |
82 |
|
82 | |||
83 | Requesting a compression format that server doesn't support results will fall back to 0.1 |
|
83 | Requesting a compression format that server doesn't support results will fall back to 0.1 | |
84 |
|
84 | |||
85 | $ get-with-headers.py --hgproto '0.2 comp=aa' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - |
|
85 | $ get-with-headers.py --hgproto '0.2 comp=aa' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' - | |
86 | 200 Script output follows |
|
86 | 200 Script output follows | |
87 | content-type: application/mercurial-0.1 |
|
87 | content-type: application/mercurial-0.1 | |
88 | date: $HTTP_DATE$ |
|
88 | date: $HTTP_DATE$ | |
89 | server: testing stub value |
|
89 | server: testing stub value | |
90 | transfer-encoding: chunked |
|
90 | transfer-encoding: chunked | |
91 |
|
91 | |||
92 | #if zstd |
|
92 | #if zstd | |
93 | zstd is used if available |
|
93 | zstd is used if available | |
94 |
|
94 | |||
95 | $ get-with-headers.py --hgproto '0.2 comp=zstd' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp |
|
95 | $ get-with-headers.py --hgproto '0.2 comp=zstd' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp | |
96 | $ f --size --hexdump --bytes 36 --sha1 resp |
|
96 | $ f --size --hexdump --bytes 36 --sha1 resp | |
97 | resp: size=248, sha1=4d8d8f87fb82bd542ce52881fdc94f850748 |
|
97 | resp: size=248, sha1=4d8d8f87fb82bd542ce52881fdc94f850748 | |
98 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| |
|
98 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| | |
99 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 7a 73 74 64 |t follows...zstd| |
|
99 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 7a 73 74 64 |t follows...zstd| | |
100 | 0020: 28 b5 2f fd |(./.| |
|
100 | 0020: 28 b5 2f fd |(./.| | |
101 |
|
101 | |||
102 | #endif |
|
102 | #endif | |
103 |
|
103 | |||
104 | application/mercurial-0.2 is not yet used on non-streaming responses |
|
104 | application/mercurial-0.2 is not yet used on non-streaming responses | |
105 |
|
105 | |||
106 | $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=heads' - |
|
106 | $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=heads' - | |
107 | 200 Script output follows |
|
107 | 200 Script output follows | |
108 | content-length: 41 |
|
108 | content-length: 41 | |
109 | content-type: application/mercurial-0.1 |
|
109 | content-type: application/mercurial-0.1 | |
110 | date: $HTTP_DATE$ |
|
110 | date: $HTTP_DATE$ | |
111 | server: testing stub value |
|
111 | server: testing stub value | |
112 |
|
112 | |||
113 | e93700bd72895c5addab234c56d4024b487a362f |
|
113 | e93700bd72895c5addab234c56d4024b487a362f | |
114 |
|
114 | |||
115 | Now test protocol preference usage |
|
115 | Now test protocol preference usage | |
116 |
|
116 | |||
117 | $ killdaemons.py |
|
117 | $ killdaemons.py | |
118 | $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid |
|
118 | $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid | |
119 | $ cat hg.pid > $DAEMON_PIDS |
|
119 | $ cat hg.pid > $DAEMON_PIDS | |
120 |
|
120 | |||
121 | No Accept will send 0.1+zlib, even though "none" is preferred b/c "none" isn't supported on 0.1 |
|
121 | No Accept will send 0.1+zlib, even though "none" is preferred b/c "none" isn't supported on 0.1 | |
122 |
|
122 | |||
123 | $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' Content-Type |
|
123 | $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' Content-Type | |
124 | 200 Script output follows |
|
124 | 200 Script output follows | |
125 | content-type: application/mercurial-0.1 |
|
125 | content-type: application/mercurial-0.1 | |
126 |
|
126 | |||
127 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp |
|
127 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp | |
128 | $ f --size --hexdump --bytes 28 --sha1 resp |
|
128 | $ f --size --hexdump --bytes 28 --sha1 resp | |
129 | resp: size=227, sha1=35a4c074da74f32f5440da3cbf04 |
|
129 | resp: size=227, sha1=35a4c074da74f32f5440da3cbf04 | |
130 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| |
|
130 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| | |
131 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 78 |t follows..x| |
|
131 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 78 |t follows..x| | |
132 |
|
132 | |||
133 | Explicit 0.1 will send zlib because "none" isn't supported on 0.1 |
|
133 | Explicit 0.1 will send zlib because "none" isn't supported on 0.1 | |
134 |
|
134 | |||
135 | $ get-with-headers.py --hgproto '0.1' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp |
|
135 | $ get-with-headers.py --hgproto '0.1' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp | |
136 | $ f --size --hexdump --bytes 28 --sha1 resp |
|
136 | $ f --size --hexdump --bytes 28 --sha1 resp | |
137 | resp: size=227, sha1=35a4c074da74f32f5440da3cbf04 |
|
137 | resp: size=227, sha1=35a4c074da74f32f5440da3cbf04 | |
138 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| |
|
138 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| | |
139 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 78 |t follows..x| |
|
139 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 78 |t follows..x| | |
140 |
|
140 | |||
141 | 0.2 with no compression will get "none" because that is server's preference |
|
141 | 0.2 with no compression will get "none" because that is server's preference | |
142 | (spec says ZL and UN are implicitly supported) |
|
142 | (spec says ZL and UN are implicitly supported) | |
143 |
|
143 | |||
144 | $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp |
|
144 | $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp | |
145 | $ f --size --hexdump --bytes 32 --sha1 resp |
|
145 | $ f --size --hexdump --bytes 32 --sha1 resp | |
146 | resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83 |
|
146 | resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83 | |
147 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| |
|
147 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| | |
148 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 6e 6f 6e 65 |t follows...none| |
|
148 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 6e 6f 6e 65 |t follows...none| | |
149 |
|
149 | |||
150 | Client receives server preference even if local order doesn't match |
|
150 | Client receives server preference even if local order doesn't match | |
151 |
|
151 | |||
152 | $ get-with-headers.py --hgproto '0.2 comp=zlib,none' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp |
|
152 | $ get-with-headers.py --hgproto '0.2 comp=zlib,none' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp | |
153 | $ f --size --hexdump --bytes 32 --sha1 resp |
|
153 | $ f --size --hexdump --bytes 32 --sha1 resp | |
154 | resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83 |
|
154 | resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83 | |
155 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| |
|
155 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| | |
156 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 6e 6f 6e 65 |t follows...none| |
|
156 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 6e 6f 6e 65 |t follows...none| | |
157 |
|
157 | |||
158 | Client receives only supported format even if not server preferred format |
|
158 | Client receives only supported format even if not server preferred format | |
159 |
|
159 | |||
160 | $ get-with-headers.py --hgproto '0.2 comp=zlib' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp |
|
160 | $ get-with-headers.py --hgproto '0.2 comp=zlib' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp | |
161 | $ f --size --hexdump --bytes 33 --sha1 resp |
|
161 | $ f --size --hexdump --bytes 33 --sha1 resp | |
162 | resp: size=232, sha1=a1c727f0c9693ca15742a75c30419bc36 |
|
162 | resp: size=232, sha1=a1c727f0c9693ca15742a75c30419bc36 | |
163 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| |
|
163 | 0000: 32 30 30 20 53 63 72 69 70 74 20 6f 75 74 70 75 |200 Script outpu| | |
164 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 7a 6c 69 62 |t follows...zlib| |
|
164 | 0010: 74 20 66 6f 6c 6c 6f 77 73 0a 0a 04 7a 6c 69 62 |t follows...zlib| | |
165 | 0020: 78 |x| |
|
165 | 0020: 78 |x| | |
166 |
|
166 | |||
167 | $ killdaemons.py |
|
167 | $ killdaemons.py | |
168 | $ cd .. |
|
168 | $ cd .. | |
169 |
|
169 | |||
170 | Test listkeys for listing namespaces |
|
170 | Test listkeys for listing namespaces | |
171 |
|
171 | |||
172 | $ hg init empty |
|
172 | $ hg init empty | |
173 | $ hg -R empty serve -p $HGPORT -d --pid-file hg.pid |
|
173 | $ hg -R empty serve -p $HGPORT -d --pid-file hg.pid | |
174 | $ cat hg.pid > $DAEMON_PIDS |
|
174 | $ cat hg.pid > $DAEMON_PIDS | |
175 |
|
175 | |||
176 | $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF |
|
176 | $ hg --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF | |
177 | > command listkeys |
|
177 | > command listkeys | |
178 | > namespace namespaces |
|
178 | > namespace namespaces | |
179 | > EOF |
|
179 | > EOF | |
180 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
180 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
181 | s> Accept-Encoding: identity\r\n |
|
181 | s> Accept-Encoding: identity\r\n | |
182 | s> accept: application/mercurial-0.1\r\n |
|
182 | s> accept: application/mercurial-0.1\r\n | |
183 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
183 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
184 | s> user-agent: Mercurial debugwireproto\r\n |
|
184 | s> user-agent: Mercurial debugwireproto\r\n | |
185 | s> \r\n |
|
185 | s> \r\n | |
186 | s> makefile('rb', None) |
|
186 | s> makefile('rb', None) | |
187 | s> HTTP/1.1 200 Script output follows\r\n |
|
187 | s> HTTP/1.1 200 Script output follows\r\n | |
188 | s> Server: testing stub value\r\n |
|
188 | s> Server: testing stub value\r\n | |
189 | s> Date: $HTTP_DATE$\r\n |
|
189 | s> Date: $HTTP_DATE$\r\n | |
190 | s> Content-Type: application/mercurial-0.1\r\n |
|
190 | s> Content-Type: application/mercurial-0.1\r\n | |
191 | s> Content-Length: *\r\n (glob) |
|
191 | s> Content-Length: *\r\n (glob) | |
192 | s> \r\n |
|
192 | s> \r\n | |
193 | 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 |
|
193 | 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 | |
194 | sending listkeys command |
|
194 | sending listkeys command | |
195 | s> GET /?cmd=listkeys HTTP/1.1\r\n |
|
195 | s> GET /?cmd=listkeys HTTP/1.1\r\n | |
196 | s> Accept-Encoding: identity\r\n |
|
196 | s> Accept-Encoding: identity\r\n | |
197 | s> vary: X-HgArg-1,X-HgProto-1\r\n |
|
197 | s> vary: X-HgArg-1,X-HgProto-1\r\n | |
198 | s> x-hgarg-1: namespace=namespaces\r\n |
|
198 | s> x-hgarg-1: namespace=namespaces\r\n | |
199 | s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n |
|
199 | s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n | |
200 | s> accept: application/mercurial-0.1\r\n |
|
200 | s> accept: application/mercurial-0.1\r\n | |
201 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
201 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
202 | s> user-agent: Mercurial debugwireproto\r\n |
|
202 | s> user-agent: Mercurial debugwireproto\r\n | |
203 | s> \r\n |
|
203 | s> \r\n | |
204 | s> makefile('rb', None) |
|
204 | s> makefile('rb', None) | |
205 | s> HTTP/1.1 200 Script output follows\r\n |
|
205 | s> HTTP/1.1 200 Script output follows\r\n | |
206 | s> Server: testing stub value\r\n |
|
206 | s> Server: testing stub value\r\n | |
207 | s> Date: $HTTP_DATE$\r\n |
|
207 | s> Date: $HTTP_DATE$\r\n | |
208 | s> Content-Type: application/mercurial-0.1\r\n |
|
208 | s> Content-Type: application/mercurial-0.1\r\n | |
209 | s> Content-Length: 30\r\n |
|
209 | s> Content-Length: 30\r\n | |
210 | s> \r\n |
|
210 | s> \r\n | |
211 | s> bookmarks\t\n |
|
211 | s> bookmarks\t\n | |
212 | s> namespaces\t\n |
|
212 | s> namespaces\t\n | |
213 | s> phases\t |
|
213 | s> phases\t | |
214 | response: {b'bookmarks': b'', b'namespaces': b'', b'phases': b''} |
|
214 | response: {b'bookmarks': b'', b'namespaces': b'', b'phases': b''} | |
215 |
|
215 | |||
216 | Same thing, but with "httprequest" command |
|
216 | Same thing, but with "httprequest" command | |
217 |
|
217 | |||
218 | $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF |
|
218 | $ hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT << EOF | |
219 | > httprequest GET ?cmd=listkeys |
|
219 | > httprequest GET ?cmd=listkeys | |
220 | > user-agent: test |
|
220 | > user-agent: test | |
221 | > x-hgarg-1: namespace=namespaces |
|
221 | > x-hgarg-1: namespace=namespaces | |
222 | > EOF |
|
222 | > EOF | |
223 | using raw connection to peer |
|
223 | using raw connection to peer | |
224 | s> GET /?cmd=listkeys HTTP/1.1\r\n |
|
224 | s> GET /?cmd=listkeys HTTP/1.1\r\n | |
225 | s> Accept-Encoding: identity\r\n |
|
225 | s> Accept-Encoding: identity\r\n | |
226 | s> user-agent: test\r\n |
|
226 | s> user-agent: test\r\n | |
227 | s> x-hgarg-1: namespace=namespaces\r\n |
|
227 | s> x-hgarg-1: namespace=namespaces\r\n | |
228 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
228 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
229 | s> \r\n |
|
229 | s> \r\n | |
230 | s> makefile('rb', None) |
|
230 | s> makefile('rb', None) | |
231 | s> HTTP/1.1 200 Script output follows\r\n |
|
231 | s> HTTP/1.1 200 Script output follows\r\n | |
232 | s> Server: testing stub value\r\n |
|
232 | s> Server: testing stub value\r\n | |
233 | s> Date: $HTTP_DATE$\r\n |
|
233 | s> Date: $HTTP_DATE$\r\n | |
234 | s> Content-Type: application/mercurial-0.1\r\n |
|
234 | s> Content-Type: application/mercurial-0.1\r\n | |
235 | s> Content-Length: 30\r\n |
|
235 | s> Content-Length: 30\r\n | |
236 | s> \r\n |
|
236 | s> \r\n | |
237 | s> bookmarks\t\n |
|
237 | s> bookmarks\t\n | |
238 | s> namespaces\t\n |
|
238 | s> namespaces\t\n | |
239 | s> phases\t |
|
239 | s> phases\t | |
240 |
|
240 | |||
241 | Client with HTTPv2 enabled advertises that and gets old capabilities response from old server |
|
241 | Client with HTTPv2 enabled advertises that and gets old capabilities response from old server | |
242 |
|
242 | |||
243 | $ hg --config experimental.httppeer.advertise-v2=true --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF |
|
243 | $ hg --config experimental.httppeer.advertise-v2=true --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF | |
244 | > command heads |
|
244 | > command heads | |
245 | > EOF |
|
245 | > EOF | |
246 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
246 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
247 | s> Accept-Encoding: identity\r\n |
|
247 | s> Accept-Encoding: identity\r\n | |
248 | s> vary: X-HgProto-1,X-HgUpgrade-1\r\n |
|
248 | s> vary: X-HgProto-1,X-HgUpgrade-1\r\n | |
249 | s> x-hgproto-1: cbor\r\n |
|
249 | s> x-hgproto-1: cbor\r\n | |
250 | s> x-hgupgrade-1: exp-http-v2-0001\r\n |
|
250 | s> x-hgupgrade-1: exp-http-v2-0001\r\n | |
251 | s> accept: application/mercurial-0.1\r\n |
|
251 | s> accept: application/mercurial-0.1\r\n | |
252 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
252 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
253 | s> user-agent: Mercurial debugwireproto\r\n |
|
253 | s> user-agent: Mercurial debugwireproto\r\n | |
254 | s> \r\n |
|
254 | s> \r\n | |
255 | s> makefile('rb', None) |
|
255 | s> makefile('rb', None) | |
256 | s> HTTP/1.1 200 Script output follows\r\n |
|
256 | s> HTTP/1.1 200 Script output follows\r\n | |
257 | s> Server: testing stub value\r\n |
|
257 | s> Server: testing stub value\r\n | |
258 | s> Date: $HTTP_DATE$\r\n |
|
258 | s> Date: $HTTP_DATE$\r\n | |
259 | s> Content-Type: application/mercurial-0.1\r\n |
|
259 | s> Content-Type: application/mercurial-0.1\r\n | |
260 |
s> Content-Length: |
|
260 | s> Content-Length: *\r\n (glob) | |
261 | s> \r\n |
|
261 | s> \r\n | |
262 | 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 |
|
262 | 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 | |
263 | sending heads command |
|
263 | sending heads command | |
264 | s> GET /?cmd=heads HTTP/1.1\r\n |
|
264 | s> GET /?cmd=heads HTTP/1.1\r\n | |
265 | s> Accept-Encoding: identity\r\n |
|
265 | s> Accept-Encoding: identity\r\n | |
266 | s> vary: X-HgProto-1\r\n |
|
266 | s> vary: X-HgProto-1\r\n | |
267 | s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n |
|
267 | s> x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n | |
268 | s> accept: application/mercurial-0.1\r\n |
|
268 | s> accept: application/mercurial-0.1\r\n | |
269 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
269 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
270 | s> user-agent: Mercurial debugwireproto\r\n |
|
270 | s> user-agent: Mercurial debugwireproto\r\n | |
271 | s> \r\n |
|
271 | s> \r\n | |
272 | s> makefile('rb', None) |
|
272 | s> makefile('rb', None) | |
273 | s> HTTP/1.1 200 Script output follows\r\n |
|
273 | s> HTTP/1.1 200 Script output follows\r\n | |
274 | s> Server: testing stub value\r\n |
|
274 | s> Server: testing stub value\r\n | |
275 | s> Date: $HTTP_DATE$\r\n |
|
275 | s> Date: $HTTP_DATE$\r\n | |
276 | s> Content-Type: application/mercurial-0.1\r\n |
|
276 | s> Content-Type: application/mercurial-0.1\r\n | |
277 | s> Content-Length: 41\r\n |
|
277 | s> Content-Length: 41\r\n | |
278 | s> \r\n |
|
278 | s> \r\n | |
279 | s> 0000000000000000000000000000000000000000\n |
|
279 | s> 0000000000000000000000000000000000000000\n | |
280 | response: [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'] |
|
280 | response: [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'] | |
281 |
|
281 | |||
282 | $ killdaemons.py |
|
282 | $ killdaemons.py | |
283 | $ enablehttpv2 empty |
|
283 | $ enablehttpv2 empty | |
284 | $ hg -R empty serve -p $HGPORT -d --pid-file hg.pid |
|
284 | $ hg -R empty serve -p $HGPORT -d --pid-file hg.pid | |
285 | $ cat hg.pid > $DAEMON_PIDS |
|
285 | $ cat hg.pid > $DAEMON_PIDS | |
286 |
|
286 | |||
287 | Client with HTTPv2 enabled automatically upgrades if the server supports it |
|
287 | Client with HTTPv2 enabled automatically upgrades if the server supports it | |
288 |
|
288 | |||
289 | $ hg --config experimental.httppeer.advertise-v2=true --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF |
|
289 | $ hg --config experimental.httppeer.advertise-v2=true --verbose debugwireproto http://$LOCALIP:$HGPORT << EOF | |
290 | > command heads |
|
290 | > command heads | |
291 | > EOF |
|
291 | > EOF | |
292 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
292 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
293 | s> Accept-Encoding: identity\r\n |
|
293 | s> Accept-Encoding: identity\r\n | |
294 | s> vary: X-HgProto-1,X-HgUpgrade-1\r\n |
|
294 | s> vary: X-HgProto-1,X-HgUpgrade-1\r\n | |
295 | s> x-hgproto-1: cbor\r\n |
|
295 | s> x-hgproto-1: cbor\r\n | |
296 | s> x-hgupgrade-1: exp-http-v2-0001\r\n |
|
296 | s> x-hgupgrade-1: exp-http-v2-0001\r\n | |
297 | s> accept: application/mercurial-0.1\r\n |
|
297 | s> accept: application/mercurial-0.1\r\n | |
298 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
298 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
299 | s> user-agent: Mercurial debugwireproto\r\n |
|
299 | s> user-agent: Mercurial debugwireproto\r\n | |
300 | s> \r\n |
|
300 | s> \r\n | |
301 | s> makefile('rb', None) |
|
301 | s> makefile('rb', None) | |
302 | s> HTTP/1.1 200 OK\r\n |
|
302 | s> HTTP/1.1 200 OK\r\n | |
303 | s> Server: testing stub value\r\n |
|
303 | s> Server: testing stub value\r\n | |
304 | s> Date: $HTTP_DATE$\r\n |
|
304 | s> Date: $HTTP_DATE$\r\n | |
305 | s> Content-Type: application/mercurial-cbor\r\n |
|
305 | s> Content-Type: application/mercurial-cbor\r\n | |
306 | s> Content-Length: *\r\n (glob) |
|
306 | s> Content-Length: *\r\n (glob) | |
307 | s> \r\n |
|
307 | s> \r\n | |
308 | s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
308 | s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
309 | sending heads command |
|
309 | sending heads command | |
310 | s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n |
|
310 | s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n | |
311 | s> Accept-Encoding: identity\r\n |
|
311 | s> Accept-Encoding: identity\r\n | |
312 | s> accept: application/mercurial-exp-framing-0005\r\n |
|
312 | s> accept: application/mercurial-exp-framing-0005\r\n | |
313 | s> content-type: application/mercurial-exp-framing-0005\r\n |
|
313 | s> content-type: application/mercurial-exp-framing-0005\r\n | |
314 | s> content-length: 20\r\n |
|
314 | s> content-length: 20\r\n | |
315 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
315 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
316 | s> user-agent: Mercurial debugwireproto\r\n |
|
316 | s> user-agent: Mercurial debugwireproto\r\n | |
317 | s> \r\n |
|
317 | s> \r\n | |
318 | s> \x0c\x00\x00\x01\x00\x01\x01\x11\xa1DnameEheads |
|
318 | s> \x0c\x00\x00\x01\x00\x01\x01\x11\xa1DnameEheads | |
319 | s> makefile('rb', None) |
|
319 | s> makefile('rb', None) | |
320 | s> HTTP/1.1 200 OK\r\n |
|
320 | s> HTTP/1.1 200 OK\r\n | |
321 | s> Server: testing stub value\r\n |
|
321 | s> Server: testing stub value\r\n | |
322 | s> Date: $HTTP_DATE$\r\n |
|
322 | s> Date: $HTTP_DATE$\r\n | |
323 | s> Content-Type: application/mercurial-exp-framing-0005\r\n |
|
323 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |
324 | s> Transfer-Encoding: chunked\r\n |
|
324 | s> Transfer-Encoding: chunked\r\n | |
325 | s> \r\n |
|
325 | s> \r\n | |
326 | s> 29\r\n |
|
326 | s> 29\r\n | |
327 | s> !\x00\x00\x01\x00\x02\x012 |
|
327 | s> !\x00\x00\x01\x00\x02\x012 | |
328 | s> \xa1FstatusBok\x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 |
|
328 | s> \xa1FstatusBok\x81T\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 | |
329 | s> \r\n |
|
329 | s> \r\n | |
330 | received frame(size=33; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) |
|
330 | received frame(size=33; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |
331 | s> 0\r\n |
|
331 | s> 0\r\n | |
332 | s> \r\n |
|
332 | s> \r\n | |
333 | response: [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'] |
|
333 | response: [b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'] | |
334 |
|
334 | |||
335 | $ killdaemons.py |
|
335 | $ killdaemons.py |
@@ -1,248 +1,248 b'' | |||||
1 | $ . $TESTDIR/wireprotohelpers.sh |
|
1 | $ . $TESTDIR/wireprotohelpers.sh | |
2 |
|
2 | |||
3 | $ hg init server |
|
3 | $ hg init server | |
4 | $ hg -R server serve -p $HGPORT -d --pid-file hg.pid -E error.log |
|
4 | $ hg -R server serve -p $HGPORT -d --pid-file hg.pid -E error.log | |
5 | $ cat hg.pid > $DAEMON_PIDS |
|
5 | $ cat hg.pid > $DAEMON_PIDS | |
6 |
|
6 | |||
7 | A normal capabilities request is serviced for version 1 |
|
7 | A normal capabilities request is serviced for version 1 | |
8 |
|
8 | |||
9 | $ sendhttpraw << EOF |
|
9 | $ sendhttpraw << EOF | |
10 | > httprequest GET ?cmd=capabilities |
|
10 | > httprequest GET ?cmd=capabilities | |
11 | > user-agent: test |
|
11 | > user-agent: test | |
12 | > EOF |
|
12 | > EOF | |
13 | using raw connection to peer |
|
13 | using raw connection to peer | |
14 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
14 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
15 | s> Accept-Encoding: identity\r\n |
|
15 | s> Accept-Encoding: identity\r\n | |
16 | s> user-agent: test\r\n |
|
16 | s> user-agent: test\r\n | |
17 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
17 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
18 | s> \r\n |
|
18 | s> \r\n | |
19 | s> makefile('rb', None) |
|
19 | s> makefile('rb', None) | |
20 | s> HTTP/1.1 200 Script output follows\r\n |
|
20 | s> HTTP/1.1 200 Script output follows\r\n | |
21 | s> Server: testing stub value\r\n |
|
21 | s> Server: testing stub value\r\n | |
22 | s> Date: $HTTP_DATE$\r\n |
|
22 | s> Date: $HTTP_DATE$\r\n | |
23 | s> Content-Type: application/mercurial-0.1\r\n |
|
23 | s> Content-Type: application/mercurial-0.1\r\n | |
24 |
s> Content-Length: |
|
24 | s> Content-Length: *\r\n (glob) | |
25 | s> \r\n |
|
25 | s> \r\n | |
26 | 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 |
|
26 | 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 | |
27 |
|
27 | |||
28 | A proper request without the API server enabled returns the legacy response |
|
28 | A proper request without the API server enabled returns the legacy response | |
29 |
|
29 | |||
30 | $ sendhttpraw << EOF |
|
30 | $ sendhttpraw << EOF | |
31 | > httprequest GET ?cmd=capabilities |
|
31 | > httprequest GET ?cmd=capabilities | |
32 | > user-agent: test |
|
32 | > user-agent: test | |
33 | > x-hgupgrade-1: foo |
|
33 | > x-hgupgrade-1: foo | |
34 | > x-hgproto-1: cbor |
|
34 | > x-hgproto-1: cbor | |
35 | > EOF |
|
35 | > EOF | |
36 | using raw connection to peer |
|
36 | using raw connection to peer | |
37 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
37 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
38 | s> Accept-Encoding: identity\r\n |
|
38 | s> Accept-Encoding: identity\r\n | |
39 | s> user-agent: test\r\n |
|
39 | s> user-agent: test\r\n | |
40 | s> x-hgproto-1: cbor\r\n |
|
40 | s> x-hgproto-1: cbor\r\n | |
41 | s> x-hgupgrade-1: foo\r\n |
|
41 | s> x-hgupgrade-1: foo\r\n | |
42 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
42 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
43 | s> \r\n |
|
43 | s> \r\n | |
44 | s> makefile('rb', None) |
|
44 | s> makefile('rb', None) | |
45 | s> HTTP/1.1 200 Script output follows\r\n |
|
45 | s> HTTP/1.1 200 Script output follows\r\n | |
46 | s> Server: testing stub value\r\n |
|
46 | s> Server: testing stub value\r\n | |
47 | s> Date: $HTTP_DATE$\r\n |
|
47 | s> Date: $HTTP_DATE$\r\n | |
48 | s> Content-Type: application/mercurial-0.1\r\n |
|
48 | s> Content-Type: application/mercurial-0.1\r\n | |
49 |
s> Content-Length: |
|
49 | s> Content-Length: *\r\n (glob) | |
50 | s> \r\n |
|
50 | s> \r\n | |
51 | 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 |
|
51 | 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 | |
52 |
|
52 | |||
53 | Restart with just API server enabled. This enables serving the new format. |
|
53 | Restart with just API server enabled. This enables serving the new format. | |
54 |
|
54 | |||
55 | $ killdaemons.py |
|
55 | $ killdaemons.py | |
56 | $ cat error.log |
|
56 | $ cat error.log | |
57 |
|
57 | |||
58 | $ cat >> server/.hg/hgrc << EOF |
|
58 | $ cat >> server/.hg/hgrc << EOF | |
59 | > [experimental] |
|
59 | > [experimental] | |
60 | > web.apiserver = true |
|
60 | > web.apiserver = true | |
61 | > EOF |
|
61 | > EOF | |
62 |
|
62 | |||
63 | $ hg -R server serve -p $HGPORT -d --pid-file hg.pid -E error.log |
|
63 | $ hg -R server serve -p $HGPORT -d --pid-file hg.pid -E error.log | |
64 | $ cat hg.pid > $DAEMON_PIDS |
|
64 | $ cat hg.pid > $DAEMON_PIDS | |
65 |
|
65 | |||
66 | X-HgUpgrade-<N> without CBOR advertisement uses legacy response |
|
66 | X-HgUpgrade-<N> without CBOR advertisement uses legacy response | |
67 |
|
67 | |||
68 | $ sendhttpraw << EOF |
|
68 | $ sendhttpraw << EOF | |
69 | > httprequest GET ?cmd=capabilities |
|
69 | > httprequest GET ?cmd=capabilities | |
70 | > user-agent: test |
|
70 | > user-agent: test | |
71 | > x-hgupgrade-1: foo bar |
|
71 | > x-hgupgrade-1: foo bar | |
72 | > EOF |
|
72 | > EOF | |
73 | using raw connection to peer |
|
73 | using raw connection to peer | |
74 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
74 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
75 | s> Accept-Encoding: identity\r\n |
|
75 | s> Accept-Encoding: identity\r\n | |
76 | s> user-agent: test\r\n |
|
76 | s> user-agent: test\r\n | |
77 | s> x-hgupgrade-1: foo bar\r\n |
|
77 | s> x-hgupgrade-1: foo bar\r\n | |
78 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
78 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
79 | s> \r\n |
|
79 | s> \r\n | |
80 | s> makefile('rb', None) |
|
80 | s> makefile('rb', None) | |
81 | s> HTTP/1.1 200 Script output follows\r\n |
|
81 | s> HTTP/1.1 200 Script output follows\r\n | |
82 | s> Server: testing stub value\r\n |
|
82 | s> Server: testing stub value\r\n | |
83 | s> Date: $HTTP_DATE$\r\n |
|
83 | s> Date: $HTTP_DATE$\r\n | |
84 | s> Content-Type: application/mercurial-0.1\r\n |
|
84 | s> Content-Type: application/mercurial-0.1\r\n | |
85 |
s> Content-Length: |
|
85 | s> Content-Length: *\r\n (glob) | |
86 | s> \r\n |
|
86 | s> \r\n | |
87 | 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 |
|
87 | 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 | |
88 |
|
88 | |||
89 | X-HgUpgrade-<N> without known serialization in X-HgProto-<N> uses legacy response |
|
89 | X-HgUpgrade-<N> without known serialization in X-HgProto-<N> uses legacy response | |
90 |
|
90 | |||
91 | $ sendhttpraw << EOF |
|
91 | $ sendhttpraw << EOF | |
92 | > httprequest GET ?cmd=capabilities |
|
92 | > httprequest GET ?cmd=capabilities | |
93 | > user-agent: test |
|
93 | > user-agent: test | |
94 | > x-hgupgrade-1: foo bar |
|
94 | > x-hgupgrade-1: foo bar | |
95 | > x-hgproto-1: some value |
|
95 | > x-hgproto-1: some value | |
96 | > EOF |
|
96 | > EOF | |
97 | using raw connection to peer |
|
97 | using raw connection to peer | |
98 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
98 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
99 | s> Accept-Encoding: identity\r\n |
|
99 | s> Accept-Encoding: identity\r\n | |
100 | s> user-agent: test\r\n |
|
100 | s> user-agent: test\r\n | |
101 | s> x-hgproto-1: some value\r\n |
|
101 | s> x-hgproto-1: some value\r\n | |
102 | s> x-hgupgrade-1: foo bar\r\n |
|
102 | s> x-hgupgrade-1: foo bar\r\n | |
103 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
103 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
104 | s> \r\n |
|
104 | s> \r\n | |
105 | s> makefile('rb', None) |
|
105 | s> makefile('rb', None) | |
106 | s> HTTP/1.1 200 Script output follows\r\n |
|
106 | s> HTTP/1.1 200 Script output follows\r\n | |
107 | s> Server: testing stub value\r\n |
|
107 | s> Server: testing stub value\r\n | |
108 | s> Date: $HTTP_DATE$\r\n |
|
108 | s> Date: $HTTP_DATE$\r\n | |
109 | s> Content-Type: application/mercurial-0.1\r\n |
|
109 | s> Content-Type: application/mercurial-0.1\r\n | |
110 |
s> Content-Length: |
|
110 | s> Content-Length: *\r\n (glob) | |
111 | s> \r\n |
|
111 | s> \r\n | |
112 | 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 |
|
112 | 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 | |
113 |
|
113 | |||
114 | X-HgUpgrade-<N> + X-HgProto-<N> headers trigger new response format |
|
114 | X-HgUpgrade-<N> + X-HgProto-<N> headers trigger new response format | |
115 |
|
115 | |||
116 | $ sendhttpraw << EOF |
|
116 | $ sendhttpraw << EOF | |
117 | > httprequest GET ?cmd=capabilities |
|
117 | > httprequest GET ?cmd=capabilities | |
118 | > user-agent: test |
|
118 | > user-agent: test | |
119 | > x-hgupgrade-1: foo bar |
|
119 | > x-hgupgrade-1: foo bar | |
120 | > x-hgproto-1: cbor |
|
120 | > x-hgproto-1: cbor | |
121 | > EOF |
|
121 | > EOF | |
122 | using raw connection to peer |
|
122 | using raw connection to peer | |
123 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
123 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
124 | s> Accept-Encoding: identity\r\n |
|
124 | s> Accept-Encoding: identity\r\n | |
125 | s> user-agent: test\r\n |
|
125 | s> user-agent: test\r\n | |
126 | s> x-hgproto-1: cbor\r\n |
|
126 | s> x-hgproto-1: cbor\r\n | |
127 | s> x-hgupgrade-1: foo bar\r\n |
|
127 | s> x-hgupgrade-1: foo bar\r\n | |
128 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
128 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
129 | s> \r\n |
|
129 | s> \r\n | |
130 | s> makefile('rb', None) |
|
130 | s> makefile('rb', None) | |
131 | s> HTTP/1.1 200 OK\r\n |
|
131 | s> HTTP/1.1 200 OK\r\n | |
132 | s> Server: testing stub value\r\n |
|
132 | s> Server: testing stub value\r\n | |
133 | s> Date: $HTTP_DATE$\r\n |
|
133 | s> Date: $HTTP_DATE$\r\n | |
134 | s> Content-Type: application/mercurial-cbor\r\n |
|
134 | s> Content-Type: application/mercurial-cbor\r\n | |
135 |
s> Content-Length: |
|
135 | s> Content-Length: *\r\n (glob) | |
136 | s> \r\n |
|
136 | s> \r\n | |
137 | s> \xa3Dapis\xa0GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
137 | s> \xa3Dapis\xa0GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
138 | cbor> {b'apibase': b'api/', b'apis': {}, b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash'} |
|
138 | cbor> {b'apibase': b'api/', b'apis': {}, b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash'} | |
139 |
|
139 | |||
140 | Restart server to enable HTTPv2 |
|
140 | Restart server to enable HTTPv2 | |
141 |
|
141 | |||
142 | $ killdaemons.py |
|
142 | $ killdaemons.py | |
143 | $ enablehttpv2 server |
|
143 | $ enablehttpv2 server | |
144 | $ hg -R server serve -p $HGPORT -d --pid-file hg.pid -E error.log |
|
144 | $ hg -R server serve -p $HGPORT -d --pid-file hg.pid -E error.log | |
145 | $ cat hg.pid > $DAEMON_PIDS |
|
145 | $ cat hg.pid > $DAEMON_PIDS | |
146 |
|
146 | |||
147 | Only requested API services are returned |
|
147 | Only requested API services are returned | |
148 |
|
148 | |||
149 | $ sendhttpraw << EOF |
|
149 | $ sendhttpraw << EOF | |
150 | > httprequest GET ?cmd=capabilities |
|
150 | > httprequest GET ?cmd=capabilities | |
151 | > user-agent: test |
|
151 | > user-agent: test | |
152 | > x-hgupgrade-1: foo bar |
|
152 | > x-hgupgrade-1: foo bar | |
153 | > x-hgproto-1: cbor |
|
153 | > x-hgproto-1: cbor | |
154 | > EOF |
|
154 | > EOF | |
155 | using raw connection to peer |
|
155 | using raw connection to peer | |
156 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
156 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
157 | s> Accept-Encoding: identity\r\n |
|
157 | s> Accept-Encoding: identity\r\n | |
158 | s> user-agent: test\r\n |
|
158 | s> user-agent: test\r\n | |
159 | s> x-hgproto-1: cbor\r\n |
|
159 | s> x-hgproto-1: cbor\r\n | |
160 | s> x-hgupgrade-1: foo bar\r\n |
|
160 | s> x-hgupgrade-1: foo bar\r\n | |
161 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
161 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
162 | s> \r\n |
|
162 | s> \r\n | |
163 | s> makefile('rb', None) |
|
163 | s> makefile('rb', None) | |
164 | s> HTTP/1.1 200 OK\r\n |
|
164 | s> HTTP/1.1 200 OK\r\n | |
165 | s> Server: testing stub value\r\n |
|
165 | s> Server: testing stub value\r\n | |
166 | s> Date: $HTTP_DATE$\r\n |
|
166 | s> Date: $HTTP_DATE$\r\n | |
167 | s> Content-Type: application/mercurial-cbor\r\n |
|
167 | s> Content-Type: application/mercurial-cbor\r\n | |
168 |
s> Content-Length: |
|
168 | s> Content-Length: *\r\n (glob) | |
169 | s> \r\n |
|
169 | s> \r\n | |
170 | s> \xa3Dapis\xa0GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
170 | s> \xa3Dapis\xa0GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
171 | cbor> {b'apibase': b'api/', b'apis': {}, b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash'} |
|
171 | cbor> {b'apibase': b'api/', b'apis': {}, b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash'} | |
172 |
|
172 | |||
173 | Request for HTTPv2 service returns information about it |
|
173 | Request for HTTPv2 service returns information about it | |
174 |
|
174 | |||
175 | $ sendhttpraw << EOF |
|
175 | $ sendhttpraw << EOF | |
176 | > httprequest GET ?cmd=capabilities |
|
176 | > httprequest GET ?cmd=capabilities | |
177 | > user-agent: test |
|
177 | > user-agent: test | |
178 | > x-hgupgrade-1: exp-http-v2-0001 foo bar |
|
178 | > x-hgupgrade-1: exp-http-v2-0001 foo bar | |
179 | > x-hgproto-1: cbor |
|
179 | > x-hgproto-1: cbor | |
180 | > EOF |
|
180 | > EOF | |
181 | using raw connection to peer |
|
181 | using raw connection to peer | |
182 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
182 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
183 | s> Accept-Encoding: identity\r\n |
|
183 | s> Accept-Encoding: identity\r\n | |
184 | s> user-agent: test\r\n |
|
184 | s> user-agent: test\r\n | |
185 | s> x-hgproto-1: cbor\r\n |
|
185 | s> x-hgproto-1: cbor\r\n | |
186 | s> x-hgupgrade-1: exp-http-v2-0001 foo bar\r\n |
|
186 | s> x-hgupgrade-1: exp-http-v2-0001 foo bar\r\n | |
187 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
187 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
188 | s> \r\n |
|
188 | s> \r\n | |
189 | s> makefile('rb', None) |
|
189 | s> makefile('rb', None) | |
190 | s> HTTP/1.1 200 OK\r\n |
|
190 | s> HTTP/1.1 200 OK\r\n | |
191 | s> Server: testing stub value\r\n |
|
191 | s> Server: testing stub value\r\n | |
192 | s> Date: $HTTP_DATE$\r\n |
|
192 | s> Date: $HTTP_DATE$\r\n | |
193 | s> Content-Type: application/mercurial-cbor\r\n |
|
193 | s> Content-Type: application/mercurial-cbor\r\n | |
194 | s> Content-Length: *\r\n (glob) |
|
194 | s> Content-Length: *\r\n (glob) | |
195 | s> \r\n |
|
195 | s> \r\n | |
196 | s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
196 | s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
197 | cbor> {b'apibase': b'api/', b'apis': {b'exp-http-v2-0001': {b'commands': {b'branchmap': {b'args': {}, b'permissions': [b'pull']}, b'capabilities': {b'args': {}, b'permissions': [b'pull']}, b'heads': {b'args': {b'publiconly': False}, b'permissions': [b'pull']}, b'known': {b'args': {b'nodes': [b'deadbeef']}, b'permissions': [b'pull']}, b'listkeys': {b'args': {b'namespace': b'ns'}, b'permissions': [b'pull']}, b'lookup': {b'args': {b'key': b'foo'}, b'permissions': [b'pull']}, b'pushkey': {b'args': {b'key': b'key', b'namespace': b'ns', b'new': b'new', b'old': b'old'}, b'permissions': [b'push']}}, b'compression': [{b'name': b'zstd'}, {b'name': b'zlib'}], b'framingmediatypes': [b'application/mercurial-exp-framing-0005'], b'rawrepoformats': [b'generaldelta', b'revlogv1']}}, b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash'} |
|
197 | cbor> {b'apibase': b'api/', b'apis': {b'exp-http-v2-0001': {b'commands': {b'branchmap': {b'args': {}, b'permissions': [b'pull']}, b'capabilities': {b'args': {}, b'permissions': [b'pull']}, b'heads': {b'args': {b'publiconly': False}, b'permissions': [b'pull']}, b'known': {b'args': {b'nodes': [b'deadbeef']}, b'permissions': [b'pull']}, b'listkeys': {b'args': {b'namespace': b'ns'}, b'permissions': [b'pull']}, b'lookup': {b'args': {b'key': b'foo'}, b'permissions': [b'pull']}, b'pushkey': {b'args': {b'key': b'key', b'namespace': b'ns', b'new': b'new', b'old': b'old'}, b'permissions': [b'push']}}, b'compression': [{b'name': b'zstd'}, {b'name': b'zlib'}], b'framingmediatypes': [b'application/mercurial-exp-framing-0005'], b'rawrepoformats': [b'generaldelta', b'revlogv1']}}, b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash'} | |
198 |
|
198 | |||
199 | capabilities command returns expected info |
|
199 | capabilities command returns expected info | |
200 |
|
200 | |||
201 | $ sendhttpv2peerhandshake << EOF |
|
201 | $ sendhttpv2peerhandshake << EOF | |
202 | > command capabilities |
|
202 | > command capabilities | |
203 | > EOF |
|
203 | > EOF | |
204 | creating http peer for wire protocol version 2 |
|
204 | creating http peer for wire protocol version 2 | |
205 | s> GET /?cmd=capabilities HTTP/1.1\r\n |
|
205 | s> GET /?cmd=capabilities HTTP/1.1\r\n | |
206 | s> Accept-Encoding: identity\r\n |
|
206 | s> Accept-Encoding: identity\r\n | |
207 | s> vary: X-HgProto-1,X-HgUpgrade-1\r\n |
|
207 | s> vary: X-HgProto-1,X-HgUpgrade-1\r\n | |
208 | s> x-hgproto-1: cbor\r\n |
|
208 | s> x-hgproto-1: cbor\r\n | |
209 | s> x-hgupgrade-1: exp-http-v2-0001\r\n |
|
209 | s> x-hgupgrade-1: exp-http-v2-0001\r\n | |
210 | s> accept: application/mercurial-0.1\r\n |
|
210 | s> accept: application/mercurial-0.1\r\n | |
211 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
211 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
212 | s> user-agent: Mercurial debugwireproto\r\n |
|
212 | s> user-agent: Mercurial debugwireproto\r\n | |
213 | s> \r\n |
|
213 | s> \r\n | |
214 | s> makefile('rb', None) |
|
214 | s> makefile('rb', None) | |
215 | s> HTTP/1.1 200 OK\r\n |
|
215 | s> HTTP/1.1 200 OK\r\n | |
216 | s> Server: testing stub value\r\n |
|
216 | s> Server: testing stub value\r\n | |
217 | s> Date: $HTTP_DATE$\r\n |
|
217 | s> Date: $HTTP_DATE$\r\n | |
218 | s> Content-Type: application/mercurial-cbor\r\n |
|
218 | s> Content-Type: application/mercurial-cbor\r\n | |
219 | s> Content-Length: *\r\n (glob) |
|
219 | s> Content-Length: *\r\n (glob) | |
220 | s> \r\n |
|
220 | s> \r\n | |
221 | s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash |
|
221 | s> \xa3Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005GapibaseDapi/Nv1capabilitiesY\x01\xcabatch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash | |
222 | sending capabilities command |
|
222 | sending capabilities command | |
223 | s> POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n |
|
223 | s> POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n | |
224 | s> Accept-Encoding: identity\r\n |
|
224 | s> Accept-Encoding: identity\r\n | |
225 | s> *\r\n (glob) |
|
225 | s> *\r\n (glob) | |
226 | s> content-type: application/mercurial-exp-framing-0005\r\n |
|
226 | s> content-type: application/mercurial-exp-framing-0005\r\n | |
227 | s> content-length: 27\r\n |
|
227 | s> content-length: 27\r\n | |
228 | s> host: $LOCALIP:$HGPORT\r\n (glob) |
|
228 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |
229 | s> user-agent: Mercurial debugwireproto\r\n |
|
229 | s> user-agent: Mercurial debugwireproto\r\n | |
230 | s> \r\n |
|
230 | s> \r\n | |
231 | s> \x13\x00\x00\x01\x00\x01\x01\x11\xa1DnameLcapabilities |
|
231 | s> \x13\x00\x00\x01\x00\x01\x01\x11\xa1DnameLcapabilities | |
232 | s> makefile('rb', None) |
|
232 | s> makefile('rb', None) | |
233 | s> HTTP/1.1 200 OK\r\n |
|
233 | s> HTTP/1.1 200 OK\r\n | |
234 | s> Server: testing stub value\r\n |
|
234 | s> Server: testing stub value\r\n | |
235 | s> Date: $HTTP_DATE$\r\n |
|
235 | s> Date: $HTTP_DATE$\r\n | |
236 | s> Content-Type: application/mercurial-exp-framing-0005\r\n |
|
236 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |
237 | s> Transfer-Encoding: chunked\r\n |
|
237 | s> Transfer-Encoding: chunked\r\n | |
238 | s> \r\n |
|
238 | s> \r\n | |
239 | s> 1e2\r\n |
|
239 | s> 1e2\r\n | |
240 | s> \xda\x01\x00\x01\x00\x02\x012 |
|
240 | s> \xda\x01\x00\x01\x00\x02\x012 | |
241 | s> \xa1FstatusBok\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005 |
|
241 | s> \xa1FstatusBok\xa4Hcommands\xa7Eheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyCnewCnewColdColdInamespaceBnsKpermissions\x81DpushHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullKcompression\x82\xa1DnameDzstd\xa1DnameDzlibNrawrepoformats\x82LgeneraldeltaHrevlogv1Qframingmediatypes\x81X&application/mercurial-exp-framing-0005 | |
242 | s> \r\n |
|
242 | s> \r\n | |
243 | received frame(size=474; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) |
|
243 | received frame(size=474; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |
244 | s> 0\r\n |
|
244 | s> 0\r\n | |
245 | s> \r\n |
|
245 | s> \r\n | |
246 | response: [{b'status': b'ok'}, {b'commands': {b'branchmap': {b'args': {}, b'permissions': [b'pull']}, b'capabilities': {b'args': {}, b'permissions': [b'pull']}, b'heads': {b'args': {b'publiconly': False}, b'permissions': [b'pull']}, b'known': {b'args': {b'nodes': [b'deadbeef']}, b'permissions': [b'pull']}, b'listkeys': {b'args': {b'namespace': b'ns'}, b'permissions': [b'pull']}, b'lookup': {b'args': {b'key': b'foo'}, b'permissions': [b'pull']}, b'pushkey': {b'args': {b'key': b'key', b'namespace': b'ns', b'new': b'new', b'old': b'old'}, b'permissions': [b'push']}}, b'compression': [{b'name': b'zstd'}, {b'name': b'zlib'}], b'framingmediatypes': [b'application/mercurial-exp-framing-0005'], b'rawrepoformats': [b'generaldelta', b'revlogv1']}] |
|
246 | response: [{b'status': b'ok'}, {b'commands': {b'branchmap': {b'args': {}, b'permissions': [b'pull']}, b'capabilities': {b'args': {}, b'permissions': [b'pull']}, b'heads': {b'args': {b'publiconly': False}, b'permissions': [b'pull']}, b'known': {b'args': {b'nodes': [b'deadbeef']}, b'permissions': [b'pull']}, b'listkeys': {b'args': {b'namespace': b'ns'}, b'permissions': [b'pull']}, b'lookup': {b'args': {b'key': b'foo'}, b'permissions': [b'pull']}, b'pushkey': {b'args': {b'key': b'key', b'namespace': b'ns', b'new': b'new', b'old': b'old'}, b'permissions': [b'push']}}, b'compression': [{b'name': b'zstd'}, {b'name': b'zlib'}], b'framingmediatypes': [b'application/mercurial-exp-framing-0005'], b'rawrepoformats': [b'generaldelta', b'revlogv1']}] | |
247 |
|
247 | |||
248 | $ cat error.log |
|
248 | $ cat error.log |
General Comments 0
You need to be logged in to leave comments.
Login now