Show More
@@ -0,0 +1,497 | |||||
|
1 | $ . $TESTDIR/wireprotohelpers.sh | |||
|
2 | ||||
|
3 | $ hg init server | |||
|
4 | $ enablehttpv2 server | |||
|
5 | $ cd server | |||
|
6 | $ echo a0 > a | |||
|
7 | $ echo b0 > b | |||
|
8 | $ mkdir -p dir0/child0 dir0/child1 dir1 | |||
|
9 | $ echo c0 > dir0/c | |||
|
10 | $ echo d0 > dir0/d | |||
|
11 | $ echo e0 > dir0/child0/e | |||
|
12 | $ echo f0 > dir0/child1/f | |||
|
13 | $ hg -q commit -A -m 'commit 0' | |||
|
14 | ||||
|
15 | $ echo a1 > a | |||
|
16 | $ echo d1 > dir0/d | |||
|
17 | $ hg commit -m 'commit 1' | |||
|
18 | $ echo f0 > dir0/child1/f | |||
|
19 | $ hg commit -m 'commit 2' | |||
|
20 | nothing changed | |||
|
21 | [1] | |||
|
22 | ||||
|
23 | $ hg -q up -r 0 | |||
|
24 | $ echo a2 > a | |||
|
25 | $ hg commit -m 'commit 3' | |||
|
26 | created new head | |||
|
27 | ||||
|
28 | $ hg log -G -T '{rev}:{node} {desc}\n' | |||
|
29 | @ 2:c8757a2ffe552850d1e0dfe60d295ebf64c196d9 commit 3 | |||
|
30 | | | |||
|
31 | | o 1:650165e803375748a94df471e5b58d85763e0b29 commit 1 | |||
|
32 | |/ | |||
|
33 | o 0:6d85ca1270b377d320098556ba5bfad34a9ee12d commit 0 | |||
|
34 | ||||
|
35 | ||||
|
36 | $ hg --debug debugindex a | |||
|
37 | rev linkrev nodeid p1 p2 | |||
|
38 | 0 0 2b4eb07319bfa077a40a2f04913659aef0da42da 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 | |||
|
39 | 1 1 9a38122997b3ac97be2a9aa2e556838341fdf2cc 2b4eb07319bfa077a40a2f04913659aef0da42da 0000000000000000000000000000000000000000 | |||
|
40 | 2 2 0879345e39377229634b420c639454156726c6b6 2b4eb07319bfa077a40a2f04913659aef0da42da 0000000000000000000000000000000000000000 | |||
|
41 | ||||
|
42 | $ hg --debug debugindex dir0/child0/e | |||
|
43 | rev linkrev nodeid p1 p2 | |||
|
44 | 0 0 bbba6c06b30f443d34ff841bc985c4d0827c6be4 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 | |||
|
45 | ||||
|
46 | $ hg serve -p $HGPORT -d --pid-file hg.pid -E error.log | |||
|
47 | $ cat hg.pid > $DAEMON_PIDS | |||
|
48 | ||||
|
49 | Missing arguments is an error | |||
|
50 | ||||
|
51 | $ sendhttpv2peer << EOF | |||
|
52 | > command filedata | |||
|
53 | > EOF | |||
|
54 | creating http peer for wire protocol version 2 | |||
|
55 | sending filedata command | |||
|
56 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
57 | s> Accept-Encoding: identity\r\n | |||
|
58 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
59 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
60 | s> content-length: 23\r\n | |||
|
61 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
62 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
63 | s> \r\n | |||
|
64 | s> \x0f\x00\x00\x01\x00\x01\x01\x11\xa1DnameHfiledata | |||
|
65 | s> makefile('rb', None) | |||
|
66 | s> HTTP/1.1 200 OK\r\n | |||
|
67 | s> Server: testing stub value\r\n | |||
|
68 | s> Date: $HTTP_DATE$\r\n | |||
|
69 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
70 | s> Transfer-Encoding: chunked\r\n | |||
|
71 | s> \r\n | |||
|
72 | s> 45\r\n | |||
|
73 | s> =\x00\x00\x01\x00\x02\x012 | |||
|
74 | s> \xa2Eerror\xa1GmessageX\x1enodes argument must be definedFstatusEerror | |||
|
75 | s> \r\n | |||
|
76 | received frame(size=61; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |||
|
77 | s> 0\r\n | |||
|
78 | s> \r\n | |||
|
79 | abort: nodes argument must be defined! | |||
|
80 | [255] | |||
|
81 | ||||
|
82 | $ sendhttpv2peer << EOF | |||
|
83 | > command filedata | |||
|
84 | > nodes eval:[] | |||
|
85 | > EOF | |||
|
86 | creating http peer for wire protocol version 2 | |||
|
87 | sending filedata command | |||
|
88 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
89 | s> Accept-Encoding: identity\r\n | |||
|
90 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
91 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
92 | s> content-length: 36\r\n | |||
|
93 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
94 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
95 | s> \r\n | |||
|
96 | s> \x1c\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa1Enodes\x80DnameHfiledata | |||
|
97 | s> makefile('rb', None) | |||
|
98 | s> HTTP/1.1 200 OK\r\n | |||
|
99 | s> Server: testing stub value\r\n | |||
|
100 | s> Date: $HTTP_DATE$\r\n | |||
|
101 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
102 | s> Transfer-Encoding: chunked\r\n | |||
|
103 | s> \r\n | |||
|
104 | s> 44\r\n | |||
|
105 | s> <\x00\x00\x01\x00\x02\x012 | |||
|
106 | s> \xa2Eerror\xa1GmessageX\x1dpath argument must be definedFstatusEerror | |||
|
107 | s> \r\n | |||
|
108 | received frame(size=60; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |||
|
109 | s> 0\r\n | |||
|
110 | s> \r\n | |||
|
111 | abort: path argument must be defined! | |||
|
112 | [255] | |||
|
113 | ||||
|
114 | Unknown node is an error | |||
|
115 | ||||
|
116 | $ sendhttpv2peer << EOF | |||
|
117 | > command filedata | |||
|
118 | > nodes eval:[b'\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa'] | |||
|
119 | > path eval:b'a' | |||
|
120 | > EOF | |||
|
121 | creating http peer for wire protocol version 2 | |||
|
122 | sending filedata command | |||
|
123 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
124 | s> Accept-Encoding: identity\r\n | |||
|
125 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
126 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
127 | s> content-length: 64\r\n | |||
|
128 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
129 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
130 | s> \r\n | |||
|
131 | s> 8\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa2Enodes\x81T\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaaDpathAaDnameHfiledata | |||
|
132 | s> makefile('rb', None) | |||
|
133 | s> HTTP/1.1 200 OK\r\n | |||
|
134 | s> Server: testing stub value\r\n | |||
|
135 | s> Date: $HTTP_DATE$\r\n | |||
|
136 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
137 | s> Transfer-Encoding: chunked\r\n | |||
|
138 | s> \r\n | |||
|
139 | s> 6b\r\n | |||
|
140 | s> c\x00\x00\x01\x00\x02\x012 | |||
|
141 | s> \xa2Eerror\xa2Dargs\x81X(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaGmessageUunknown file node: %sFstatusEerror | |||
|
142 | s> \r\n | |||
|
143 | received frame(size=99; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=eos) | |||
|
144 | s> 0\r\n | |||
|
145 | s> \r\n | |||
|
146 | abort: unknown file node: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa! | |||
|
147 | [255] | |||
|
148 | ||||
|
149 | Fetching a single revision returns just metadata by default | |||
|
150 | ||||
|
151 | $ sendhttpv2peer << EOF | |||
|
152 | > command filedata | |||
|
153 | > nodes eval:[b'\x9a\x38\x12\x29\x97\xb3\xac\x97\xbe\x2a\x9a\xa2\xe5\x56\x83\x83\x41\xfd\xf2\xcc'] | |||
|
154 | > path eval:b'a' | |||
|
155 | > EOF | |||
|
156 | creating http peer for wire protocol version 2 | |||
|
157 | sending filedata command | |||
|
158 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
159 | s> Accept-Encoding: identity\r\n | |||
|
160 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
161 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
162 | s> content-length: 64\r\n | |||
|
163 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
164 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
165 | s> \r\n | |||
|
166 | s> 8\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa2Enodes\x81T\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccDpathAaDnameHfiledata | |||
|
167 | s> makefile('rb', None) | |||
|
168 | s> HTTP/1.1 200 OK\r\n | |||
|
169 | s> Server: testing stub value\r\n | |||
|
170 | s> Date: $HTTP_DATE$\r\n | |||
|
171 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
172 | s> Transfer-Encoding: chunked\r\n | |||
|
173 | s> \r\n | |||
|
174 | s> 13\r\n | |||
|
175 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
176 | s> \xa1FstatusBok | |||
|
177 | s> \r\n | |||
|
178 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
|
179 | s> 30\r\n | |||
|
180 | s> (\x00\x00\x01\x00\x02\x001 | |||
|
181 | s> \xa1Jtotalitems\x01\xa1DnodeT\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc | |||
|
182 | s> \r\n | |||
|
183 | received frame(size=40; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |||
|
184 | s> 8\r\n | |||
|
185 | s> \x00\x00\x00\x01\x00\x02\x002 | |||
|
186 | s> \r\n | |||
|
187 | s> 0\r\n | |||
|
188 | s> \r\n | |||
|
189 | received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) | |||
|
190 | response: gen[ | |||
|
191 | { | |||
|
192 | b'totalitems': 1 | |||
|
193 | }, | |||
|
194 | { | |||
|
195 | b'node': b'\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc' | |||
|
196 | } | |||
|
197 | ] | |||
|
198 | ||||
|
199 | Requesting parents works | |||
|
200 | ||||
|
201 | $ sendhttpv2peer << EOF | |||
|
202 | > command filedata | |||
|
203 | > nodes eval:[b'\x9a\x38\x12\x29\x97\xb3\xac\x97\xbe\x2a\x9a\xa2\xe5\x56\x83\x83\x41\xfd\xf2\xcc'] | |||
|
204 | > path eval:b'a' | |||
|
205 | > fields eval:[b'parents'] | |||
|
206 | > EOF | |||
|
207 | creating http peer for wire protocol version 2 | |||
|
208 | sending filedata command | |||
|
209 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
210 | s> Accept-Encoding: identity\r\n | |||
|
211 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
212 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
213 | s> content-length: 80\r\n | |||
|
214 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
215 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
216 | s> \r\n | |||
|
217 | s> H\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa3Ffields\x81GparentsEnodes\x81T\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccDpathAaDnameHfiledata | |||
|
218 | s> makefile('rb', None) | |||
|
219 | s> HTTP/1.1 200 OK\r\n | |||
|
220 | s> Server: testing stub value\r\n | |||
|
221 | s> Date: $HTTP_DATE$\r\n | |||
|
222 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
223 | s> Transfer-Encoding: chunked\r\n | |||
|
224 | s> \r\n | |||
|
225 | s> 13\r\n | |||
|
226 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
227 | s> \xa1FstatusBok | |||
|
228 | s> \r\n | |||
|
229 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
|
230 | s> 63\r\n | |||
|
231 | s> [\x00\x00\x01\x00\x02\x001 | |||
|
232 | s> \xa1Jtotalitems\x01\xa2DnodeT\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccGparents\x82T+N\xb0s\x19\xbf\xa0w\xa4\n | |||
|
233 | s> /\x04\x916Y\xae\xf0\xdaB\xdaT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 | |||
|
234 | s> \r\n | |||
|
235 | received frame(size=91; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |||
|
236 | s> 8\r\n | |||
|
237 | s> \x00\x00\x00\x01\x00\x02\x002 | |||
|
238 | s> \r\n | |||
|
239 | s> 0\r\n | |||
|
240 | s> \r\n | |||
|
241 | received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) | |||
|
242 | response: gen[ | |||
|
243 | { | |||
|
244 | b'totalitems': 1 | |||
|
245 | }, | |||
|
246 | { | |||
|
247 | b'node': b'\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc', | |||
|
248 | b'parents': [ | |||
|
249 | b'+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |||
|
250 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' | |||
|
251 | ] | |||
|
252 | } | |||
|
253 | ] | |||
|
254 | ||||
|
255 | Requesting revision data works | |||
|
256 | ||||
|
257 | $ sendhttpv2peer << EOF | |||
|
258 | > command filedata | |||
|
259 | > nodes eval:[b'\x9a\x38\x12\x29\x97\xb3\xac\x97\xbe\x2a\x9a\xa2\xe5\x56\x83\x83\x41\xfd\xf2\xcc'] | |||
|
260 | > path eval:b'a' | |||
|
261 | > fields eval:[b'revision'] | |||
|
262 | > EOF | |||
|
263 | creating http peer for wire protocol version 2 | |||
|
264 | sending filedata command | |||
|
265 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
266 | s> Accept-Encoding: identity\r\n | |||
|
267 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
268 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
269 | s> content-length: 81\r\n | |||
|
270 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
271 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
272 | s> \r\n | |||
|
273 | s> I\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa3Ffields\x81HrevisionEnodes\x81T\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccDpathAaDnameHfiledata | |||
|
274 | s> makefile('rb', None) | |||
|
275 | s> HTTP/1.1 200 OK\r\n | |||
|
276 | s> Server: testing stub value\r\n | |||
|
277 | s> Date: $HTTP_DATE$\r\n | |||
|
278 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
279 | s> Transfer-Encoding: chunked\r\n | |||
|
280 | s> \r\n | |||
|
281 | s> 13\r\n | |||
|
282 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
283 | s> \xa1FstatusBok | |||
|
284 | s> \r\n | |||
|
285 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
|
286 | s> 6e\r\n | |||
|
287 | s> f\x00\x00\x01\x00\x02\x001 | |||
|
288 | s> \xa1Jtotalitems\x01\xa3MdeltabasenodeT+N\xb0s\x19\xbf\xa0w\xa4\n | |||
|
289 | s> /\x04\x916Y\xae\xf0\xdaB\xdaIdeltasize\x0fDnodeT\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccO\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03a1\n | |||
|
290 | s> \r\n | |||
|
291 | received frame(size=102; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |||
|
292 | s> 8\r\n | |||
|
293 | s> \x00\x00\x00\x01\x00\x02\x002 | |||
|
294 | s> \r\n | |||
|
295 | s> 0\r\n | |||
|
296 | s> \r\n | |||
|
297 | received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) | |||
|
298 | response: gen[ | |||
|
299 | { | |||
|
300 | b'totalitems': 1 | |||
|
301 | }, | |||
|
302 | { | |||
|
303 | b'deltabasenode': b'+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |||
|
304 | b'deltasize': 15, | |||
|
305 | b'node': b'\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc' | |||
|
306 | }, | |||
|
307 | b'\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03a1\n' | |||
|
308 | ] | |||
|
309 | ||||
|
310 | Requesting multiple revisions works | |||
|
311 | (first revision should be fulltext, subsequents are deltas) | |||
|
312 | ||||
|
313 | $ sendhttpv2peer << EOF | |||
|
314 | > command filedata | |||
|
315 | > nodes eval:['\x2b\x4e\xb0\x73\x19\xbf\xa0\x77\xa4\x0a\x2f\x04\x91\x36\x59\xae\xf0\xda\x42\xda', '\x9a\x38\x12\x29\x97\xb3\xac\x97\xbe\x2a\x9a\xa2\xe5\x56\x83\x83\x41\xfd\xf2\xcc'] | |||
|
316 | > path eval:b'a' | |||
|
317 | > fields eval:[b'revision'] | |||
|
318 | > EOF | |||
|
319 | creating http peer for wire protocol version 2 | |||
|
320 | sending filedata command | |||
|
321 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
322 | s> Accept-Encoding: identity\r\n | |||
|
323 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
324 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
325 | s> content-length: 102\r\n | |||
|
326 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
327 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
328 | s> \r\n | |||
|
329 | s> ^\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa3Ffields\x81HrevisionEnodes\x82T+N\xb0s\x19\xbf\xa0w\xa4\n | |||
|
330 | s> /\x04\x916Y\xae\xf0\xdaB\xdaT\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccDpathAaDnameHfiledata | |||
|
331 | s> makefile('rb', None) | |||
|
332 | s> HTTP/1.1 200 OK\r\n | |||
|
333 | s> Server: testing stub value\r\n | |||
|
334 | s> Date: $HTTP_DATE$\r\n | |||
|
335 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
336 | s> Transfer-Encoding: chunked\r\n | |||
|
337 | s> \r\n | |||
|
338 | s> 13\r\n | |||
|
339 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
340 | s> \xa1FstatusBok | |||
|
341 | s> \r\n | |||
|
342 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
|
343 | s> 9b\r\n | |||
|
344 | s> \x93\x00\x00\x01\x00\x02\x001 | |||
|
345 | s> \xa1Jtotalitems\x02\xa2DnodeT+N\xb0s\x19\xbf\xa0w\xa4\n | |||
|
346 | s> /\x04\x916Y\xae\xf0\xdaB\xdaLrevisionsize\x03Ca0\n | |||
|
347 | s> \xa3MdeltabasenodeT+N\xb0s\x19\xbf\xa0w\xa4\n | |||
|
348 | s> /\x04\x916Y\xae\xf0\xdaB\xdaIdeltasize\x0fDnodeT\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccO\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03a1\n | |||
|
349 | s> \r\n | |||
|
350 | received frame(size=147; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |||
|
351 | s> 8\r\n | |||
|
352 | s> \x00\x00\x00\x01\x00\x02\x002 | |||
|
353 | s> \r\n | |||
|
354 | s> 0\r\n | |||
|
355 | s> \r\n | |||
|
356 | received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) | |||
|
357 | response: gen[ | |||
|
358 | { | |||
|
359 | b'totalitems': 2 | |||
|
360 | }, | |||
|
361 | { | |||
|
362 | b'node': b'+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |||
|
363 | b'revisionsize': 3 | |||
|
364 | }, | |||
|
365 | b'a0\n', | |||
|
366 | { | |||
|
367 | b'deltabasenode': b'+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |||
|
368 | b'deltasize': 15, | |||
|
369 | b'node': b'\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc' | |||
|
370 | }, | |||
|
371 | b'\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03a1\n' | |||
|
372 | ] | |||
|
373 | ||||
|
374 | Revisions are sorted by DAG order, parents first | |||
|
375 | ||||
|
376 | $ sendhttpv2peer << EOF | |||
|
377 | > command filedata | |||
|
378 | > nodes eval:['\x9a\x38\x12\x29\x97\xb3\xac\x97\xbe\x2a\x9a\xa2\xe5\x56\x83\x83\x41\xfd\xf2\xcc', '\x2b\x4e\xb0\x73\x19\xbf\xa0\x77\xa4\x0a\x2f\x04\x91\x36\x59\xae\xf0\xda\x42\xda'] | |||
|
379 | > path eval:b'a' | |||
|
380 | > fields eval:[b'revision'] | |||
|
381 | > EOF | |||
|
382 | creating http peer for wire protocol version 2 | |||
|
383 | sending filedata command | |||
|
384 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
385 | s> Accept-Encoding: identity\r\n | |||
|
386 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
387 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
388 | s> content-length: 102\r\n | |||
|
389 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
390 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
391 | s> \r\n | |||
|
392 | s> ^\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa3Ffields\x81HrevisionEnodes\x82T\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccT+N\xb0s\x19\xbf\xa0w\xa4\n | |||
|
393 | s> /\x04\x916Y\xae\xf0\xdaB\xdaDpathAaDnameHfiledata | |||
|
394 | s> makefile('rb', None) | |||
|
395 | s> HTTP/1.1 200 OK\r\n | |||
|
396 | s> Server: testing stub value\r\n | |||
|
397 | s> Date: $HTTP_DATE$\r\n | |||
|
398 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
399 | s> Transfer-Encoding: chunked\r\n | |||
|
400 | s> \r\n | |||
|
401 | s> 13\r\n | |||
|
402 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
403 | s> \xa1FstatusBok | |||
|
404 | s> \r\n | |||
|
405 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
|
406 | s> 9b\r\n | |||
|
407 | s> \x93\x00\x00\x01\x00\x02\x001 | |||
|
408 | s> \xa1Jtotalitems\x02\xa2DnodeT+N\xb0s\x19\xbf\xa0w\xa4\n | |||
|
409 | s> /\x04\x916Y\xae\xf0\xdaB\xdaLrevisionsize\x03Ca0\n | |||
|
410 | s> \xa3MdeltabasenodeT+N\xb0s\x19\xbf\xa0w\xa4\n | |||
|
411 | s> /\x04\x916Y\xae\xf0\xdaB\xdaIdeltasize\x0fDnodeT\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccO\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03a1\n | |||
|
412 | s> \r\n | |||
|
413 | received frame(size=147; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |||
|
414 | s> 8\r\n | |||
|
415 | s> \x00\x00\x00\x01\x00\x02\x002 | |||
|
416 | s> \r\n | |||
|
417 | s> 0\r\n | |||
|
418 | s> \r\n | |||
|
419 | received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) | |||
|
420 | response: gen[ | |||
|
421 | { | |||
|
422 | b'totalitems': 2 | |||
|
423 | }, | |||
|
424 | { | |||
|
425 | b'node': b'+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |||
|
426 | b'revisionsize': 3 | |||
|
427 | }, | |||
|
428 | b'a0\n', | |||
|
429 | { | |||
|
430 | b'deltabasenode': b'+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |||
|
431 | b'deltasize': 15, | |||
|
432 | b'node': b'\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc' | |||
|
433 | }, | |||
|
434 | b'\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03a1\n' | |||
|
435 | ] | |||
|
436 | ||||
|
437 | Requesting parents and revision data works | |||
|
438 | ||||
|
439 | $ sendhttpv2peer << EOF | |||
|
440 | > command filedata | |||
|
441 | > nodes eval:['\x08\x79\x34\x5e\x39\x37\x72\x29\x63\x4b\x42\x0c\x63\x94\x54\x15\x67\x26\xc6\xb6'] | |||
|
442 | > path eval:b'a' | |||
|
443 | > fields eval:[b'parents', b'revision'] | |||
|
444 | > EOF | |||
|
445 | creating http peer for wire protocol version 2 | |||
|
446 | sending filedata command | |||
|
447 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
448 | s> Accept-Encoding: identity\r\n | |||
|
449 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
450 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
451 | s> content-length: 89\r\n | |||
|
452 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
453 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
454 | s> \r\n | |||
|
455 | s> Q\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa3Ffields\x82GparentsHrevisionEnodes\x81T\x08y4^97r)cKB\x0cc\x94T\x15g&\xc6\xb6DpathAaDnameHfiledata | |||
|
456 | s> makefile('rb', None) | |||
|
457 | s> HTTP/1.1 200 OK\r\n | |||
|
458 | s> Server: testing stub value\r\n | |||
|
459 | s> Date: $HTTP_DATE$\r\n | |||
|
460 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
461 | s> Transfer-Encoding: chunked\r\n | |||
|
462 | s> \r\n | |||
|
463 | s> 13\r\n | |||
|
464 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
465 | s> \xa1FstatusBok | |||
|
466 | s> \r\n | |||
|
467 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
|
468 | s> a1\r\n | |||
|
469 | s> \x99\x00\x00\x01\x00\x02\x001 | |||
|
470 | s> \xa1Jtotalitems\x01\xa4MdeltabasenodeT+N\xb0s\x19\xbf\xa0w\xa4\n | |||
|
471 | s> /\x04\x916Y\xae\xf0\xdaB\xdaIdeltasize\x0fDnodeT\x08y4^97r)cKB\x0cc\x94T\x15g&\xc6\xb6Gparents\x82T+N\xb0s\x19\xbf\xa0w\xa4\n | |||
|
472 | s> /\x04\x916Y\xae\xf0\xdaB\xdaT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00O\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03a2\n | |||
|
473 | s> \r\n | |||
|
474 | received frame(size=153; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |||
|
475 | s> 8\r\n | |||
|
476 | s> \x00\x00\x00\x01\x00\x02\x002 | |||
|
477 | s> \r\n | |||
|
478 | s> 0\r\n | |||
|
479 | s> \r\n | |||
|
480 | received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) | |||
|
481 | response: gen[ | |||
|
482 | { | |||
|
483 | b'totalitems': 1 | |||
|
484 | }, | |||
|
485 | { | |||
|
486 | b'deltabasenode': b'+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |||
|
487 | b'deltasize': 15, | |||
|
488 | b'node': b'\x08y4^97r)cKB\x0cc\x94T\x15g&\xc6\xb6', | |||
|
489 | b'parents': [ | |||
|
490 | b'+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |||
|
491 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' | |||
|
492 | ] | |||
|
493 | }, | |||
|
494 | b'\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03a2\n' | |||
|
495 | ] | |||
|
496 | ||||
|
497 | $ cat error.log |
@@ -196,6 +196,79 TODO support depth limiting | |||||
196 | TODO support hgtagsfnodes cache / tags data |
|
196 | TODO support hgtagsfnodes cache / tags data | |
197 | TODO support branch heads cache |
|
197 | TODO support branch heads cache | |
198 |
|
198 | |||
|
199 | filedata | |||
|
200 | -------- | |||
|
201 | ||||
|
202 | Obtain various data related to an individual tracked file. | |||
|
203 | ||||
|
204 | The command accepts the following arguments: | |||
|
205 | ||||
|
206 | fields | |||
|
207 | (set of bytestring) Which data associated with a file to fetch. | |||
|
208 | The following values are recognized: | |||
|
209 | ||||
|
210 | parents | |||
|
211 | Parent nodes for the revision. | |||
|
212 | ||||
|
213 | revision | |||
|
214 | The raw revision data for a file. | |||
|
215 | ||||
|
216 | nodes | |||
|
217 | (array of bytestrings) File nodes whose data to retrieve. | |||
|
218 | ||||
|
219 | path | |||
|
220 | (bytestring) Path of the tracked file whose data to retrieve. | |||
|
221 | ||||
|
222 | TODO allow specifying revisions via alternate means (such as from | |||
|
223 | changeset revisions or ranges) | |||
|
224 | ||||
|
225 | The response bytestream starts with a CBOR map describing the data that | |||
|
226 | follows. It has the following bytestream keys: | |||
|
227 | ||||
|
228 | totalitems | |||
|
229 | (unsigned integer) Total number of file revisions whose data is | |||
|
230 | being returned. | |||
|
231 | ||||
|
232 | Following the header map is a series of 0 or more CBOR values. The first | |||
|
233 | value is always a map describing a file revision. If this map has the | |||
|
234 | ``deltasize`` or ``revisionsize`` keys, a bytestring containing the delta | |||
|
235 | or revision, respectively, will immediately follow the map. Otherwise | |||
|
236 | the next value will be a map describing the next file revision. | |||
|
237 | ||||
|
238 | Each map has the following bytestring keys: | |||
|
239 | ||||
|
240 | node | |||
|
241 | (bytestring) The node of the file revision whose data is represented. | |||
|
242 | ||||
|
243 | deltabasenode | |||
|
244 | (bytestring) Node of the file revision the following delta is against. | |||
|
245 | ||||
|
246 | Only present if the ``revision`` field is requested and delta data | |||
|
247 | follows this map. | |||
|
248 | ||||
|
249 | deltasize | |||
|
250 | (unsigned integer) The size of the delta data that follows this map. | |||
|
251 | ||||
|
252 | Only present if the ``revision`` field is requested and delta data | |||
|
253 | follows this map. | |||
|
254 | ||||
|
255 | parents | |||
|
256 | (array of bytestring) The nodes of the parents of this file revision. | |||
|
257 | ||||
|
258 | Only present if the ``parents`` field is requested. | |||
|
259 | ||||
|
260 | revisionsize | |||
|
261 | (unsigned integer) The size of the fulltext revision data that follows | |||
|
262 | this map. | |||
|
263 | ||||
|
264 | Only present if the ``revision`` field is requested and fulltext revision | |||
|
265 | data follows this map. | |||
|
266 | ||||
|
267 | When ``revision`` data is requested, the server chooses to emit either fulltext | |||
|
268 | revision data or a delta. What the server decides can be inferred by looking | |||
|
269 | for the presence of the ``deltasize`` or ``revisionsize`` keys in the map. | |||
|
270 | Servers MUST NOT define both keys. | |||
|
271 | ||||
199 | heads |
|
272 | heads | |
200 | ----- |
|
273 | ----- | |
201 |
|
274 |
@@ -10,6 +10,7 import contextlib | |||||
10 |
|
10 | |||
11 | from .i18n import _ |
|
11 | from .i18n import _ | |
12 | from .node import ( |
|
12 | from .node import ( | |
|
13 | hex, | |||
13 | nullid, |
|
14 | nullid, | |
14 | nullrev, |
|
15 | nullrev, | |
15 | ) |
|
16 | ) | |
@@ -648,6 +649,112 def changesetdata(repo, proto, noderange | |||||
648 | b'bookmarks': sorted(marks), |
|
649 | b'bookmarks': sorted(marks), | |
649 | } |
|
650 | } | |
650 |
|
651 | |||
|
652 | class FileAccessError(Exception): | |||
|
653 | """Represents an error accessing a specific file.""" | |||
|
654 | ||||
|
655 | def __init__(self, path, msg, args): | |||
|
656 | self.path = path | |||
|
657 | self.msg = msg | |||
|
658 | self.args = args | |||
|
659 | ||||
|
660 | def getfilestore(repo, proto, path): | |||
|
661 | """Obtain a file storage object for use with wire protocol. | |||
|
662 | ||||
|
663 | Exists as a standalone function so extensions can monkeypatch to add | |||
|
664 | access control. | |||
|
665 | """ | |||
|
666 | # This seems to work even if the file doesn't exist. So catch | |||
|
667 | # "empty" files and return an error. | |||
|
668 | fl = repo.file(path) | |||
|
669 | ||||
|
670 | if not len(fl): | |||
|
671 | raise FileAccessError(path, 'unknown file: %s', (path,)) | |||
|
672 | ||||
|
673 | return fl | |||
|
674 | ||||
|
675 | @wireprotocommand('filedata', | |||
|
676 | args={ | |||
|
677 | 'nodes': [b'0123456...'], | |||
|
678 | 'fields': [b'parents', b'revision'], | |||
|
679 | 'path': b'foo.txt', | |||
|
680 | }, | |||
|
681 | permission='pull') | |||
|
682 | def filedata(repo, proto, nodes=None, fields=None, path=None): | |||
|
683 | fields = fields or set() | |||
|
684 | ||||
|
685 | if nodes is None: | |||
|
686 | raise error.WireprotoCommandError('nodes argument must be defined') | |||
|
687 | ||||
|
688 | if path is None: | |||
|
689 | raise error.WireprotoCommandError('path argument must be defined') | |||
|
690 | ||||
|
691 | try: | |||
|
692 | # Extensions may wish to access the protocol handler. | |||
|
693 | store = getfilestore(repo, proto, path) | |||
|
694 | except FileAccessError as e: | |||
|
695 | raise error.WireprotoCommandError(e.msg, e.args) | |||
|
696 | ||||
|
697 | # Validate requested nodes. | |||
|
698 | for node in nodes: | |||
|
699 | try: | |||
|
700 | store.rev(node) | |||
|
701 | except error.LookupError: | |||
|
702 | raise error.WireprotoCommandError('unknown file node: %s', | |||
|
703 | (hex(node),)) | |||
|
704 | ||||
|
705 | revs, requests = builddeltarequests(store, nodes) | |||
|
706 | ||||
|
707 | yield { | |||
|
708 | b'totalitems': len(revs), | |||
|
709 | } | |||
|
710 | ||||
|
711 | if b'revision' in fields: | |||
|
712 | deltas = store.emitrevisiondeltas(requests) | |||
|
713 | else: | |||
|
714 | deltas = None | |||
|
715 | ||||
|
716 | for rev in revs: | |||
|
717 | node = store.node(rev) | |||
|
718 | ||||
|
719 | if deltas is not None: | |||
|
720 | delta = next(deltas) | |||
|
721 | else: | |||
|
722 | delta = None | |||
|
723 | ||||
|
724 | d = { | |||
|
725 | b'node': node, | |||
|
726 | } | |||
|
727 | ||||
|
728 | if b'parents' in fields: | |||
|
729 | d[b'parents'] = store.parents(node) | |||
|
730 | ||||
|
731 | if b'revision' in fields: | |||
|
732 | assert delta is not None | |||
|
733 | assert delta.flags == 0 | |||
|
734 | assert d[b'node'] == delta.node | |||
|
735 | ||||
|
736 | if delta.revision is not None: | |||
|
737 | revisiondata = delta.revision | |||
|
738 | d[b'revisionsize'] = len(revisiondata) | |||
|
739 | else: | |||
|
740 | d[b'deltabasenode'] = delta.basenode | |||
|
741 | revisiondata = delta.delta | |||
|
742 | d[b'deltasize'] = len(revisiondata) | |||
|
743 | else: | |||
|
744 | revisiondata = None | |||
|
745 | ||||
|
746 | yield d | |||
|
747 | ||||
|
748 | if revisiondata is not None: | |||
|
749 | yield revisiondata | |||
|
750 | ||||
|
751 | if deltas is not None: | |||
|
752 | try: | |||
|
753 | next(deltas) | |||
|
754 | raise error.ProgrammingError('should not have more deltas') | |||
|
755 | except GeneratorExit: | |||
|
756 | pass | |||
|
757 | ||||
651 | @wireprotocommand('heads', |
|
758 | @wireprotocommand('heads', | |
652 | args={ |
|
759 | args={ | |
653 | 'publiconly': False, |
|
760 | 'publiconly': False, |
@@ -313,7 +313,7 Client with HTTPv2 enabled automatically | |||||
313 | s> Content-Type: application/mercurial-cbor\r\n |
|
313 | s> Content-Type: application/mercurial-cbor\r\n | |
314 | s> Content-Length: *\r\n (glob) |
|
314 | s> Content-Length: *\r\n (glob) | |
315 | s> \r\n |
|
315 | s> \r\n | |
316 |
s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa |
|
316 | s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa3Ffields\x82GparentsHrevisionEnodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa3Ffields\x82GparentsHrevisionEnodes\x81J0123456...Dtree@Kpermissions\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 | |
317 | sending heads command |
|
317 | sending heads command | |
318 | s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n |
|
318 | s> POST /api/exp-http-v2-0001/ro/heads HTTP/1.1\r\n | |
319 | s> Accept-Encoding: identity\r\n |
|
319 | s> Accept-Encoding: identity\r\n |
@@ -212,7 +212,7 Request for HTTPv2 service returns infor | |||||
212 | s> Content-Type: application/mercurial-cbor\r\n |
|
212 | s> Content-Type: application/mercurial-cbor\r\n | |
213 | s> Content-Length: *\r\n (glob) |
|
213 | s> Content-Length: *\r\n (glob) | |
214 | s> \r\n |
|
214 | s> \r\n | |
215 |
s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa |
|
215 | s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa3Ffields\x82GparentsHrevisionEnodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa3Ffields\x82GparentsHrevisionEnodes\x81J0123456...Dtree@Kpermissions\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 | |
216 | cbor> { |
|
216 | cbor> { | |
217 | b'apibase': b'api/', |
|
217 | b'apibase': b'api/', | |
218 | b'apis': { |
|
218 | b'apis': { | |
@@ -252,6 +252,21 Request for HTTPv2 service returns infor | |||||
252 | b'pull' |
|
252 | b'pull' | |
253 | ] |
|
253 | ] | |
254 | }, |
|
254 | }, | |
|
255 | b'filedata': { | |||
|
256 | b'args': { | |||
|
257 | b'fields': [ | |||
|
258 | b'parents', | |||
|
259 | b'revision' | |||
|
260 | ], | |||
|
261 | b'nodes': [ | |||
|
262 | b'0123456...' | |||
|
263 | ], | |||
|
264 | b'path': b'foo.txt' | |||
|
265 | }, | |||
|
266 | b'permissions': [ | |||
|
267 | b'pull' | |||
|
268 | ] | |||
|
269 | }, | |||
255 | b'heads': { |
|
270 | b'heads': { | |
256 | b'args': { |
|
271 | b'args': { | |
257 | b'publiconly': False |
|
272 | b'publiconly': False | |
@@ -352,7 +367,7 capabilities command returns expected in | |||||
352 | s> Content-Type: application/mercurial-cbor\r\n |
|
367 | s> Content-Type: application/mercurial-cbor\r\n | |
353 | s> Content-Length: *\r\n (glob) |
|
368 | s> Content-Length: *\r\n (glob) | |
354 | s> \r\n |
|
369 | s> \r\n | |
355 |
s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xa |
|
370 | s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0001\xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa3Ffields\x82GparentsHrevisionEnodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa3Ffields\x82GparentsHrevisionEnodes\x81J0123456...Dtree@Kpermissions\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 | |
356 | sending capabilities command |
|
371 | sending capabilities command | |
357 | s> POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n |
|
372 | s> POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n | |
358 | s> Accept-Encoding: identity\r\n |
|
373 | s> Accept-Encoding: identity\r\n | |
@@ -375,11 +390,11 capabilities command returns expected in | |||||
375 | s> \xa1FstatusBok |
|
390 | s> \xa1FstatusBok | |
376 | s> \r\n |
|
391 | s> \r\n | |
377 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) |
|
392 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |
378 |
s> 2 |
|
393 | s> 2f4\r\n | |
379 |
s> \x |
|
394 | s> \xec\x02\x00\x01\x00\x02\x001 | |
380 |
s> \xa4Hcommands\xa |
|
395 | s> \xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa3Ffields\x82GparentsHrevisionEnodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa3Ffields\x82GparentsHrevisionEnodes\x81J0123456...Dtree@Kpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1 | |
381 | s> \r\n |
|
396 | s> \r\n | |
382 |
received frame(size= |
|
397 | received frame(size=748; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |
383 | s> 8\r\n |
|
398 | s> 8\r\n | |
384 | s> \x00\x00\x00\x01\x00\x02\x002 |
|
399 | s> \x00\x00\x00\x01\x00\x02\x002 | |
385 | s> \r\n |
|
400 | s> \r\n | |
@@ -423,6 +438,21 capabilities command returns expected in | |||||
423 | b'pull' |
|
438 | b'pull' | |
424 | ] |
|
439 | ] | |
425 | }, |
|
440 | }, | |
|
441 | b'filedata': { | |||
|
442 | b'args': { | |||
|
443 | b'fields': [ | |||
|
444 | b'parents', | |||
|
445 | b'revision' | |||
|
446 | ], | |||
|
447 | b'nodes': [ | |||
|
448 | b'0123456...' | |||
|
449 | ], | |||
|
450 | b'path': b'foo.txt' | |||
|
451 | }, | |||
|
452 | b'permissions': [ | |||
|
453 | b'pull' | |||
|
454 | ] | |||
|
455 | }, | |||
426 | b'heads': { |
|
456 | b'heads': { | |
427 | b'args': { |
|
457 | b'args': { | |
428 | b'publiconly': False |
|
458 | b'publiconly': False |
General Comments 0
You need to be logged in to leave comments.
Login now