Mercurial > hg
comparison tests/test-wireproto-command-capabilities.t @ 40017:426cb2859013
debugcommands: print all CBOR objects
application/mercurial-cbor may contain multiple objects. Let's print
all of them.
Differential Revision: https://phab.mercurial-scm.org/D4769
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 26 Sep 2018 14:54:15 -0700 |
parents | d3d333ab167a |
children | 393e44324037 |
comparison
equal
deleted
inserted
replaced
40016:1f12a3ad93f2 | 40017:426cb2859013 |
---|---|
144 s> Date: $HTTP_DATE$\r\n | 144 s> Date: $HTTP_DATE$\r\n |
145 s> Content-Type: application/mercurial-cbor\r\n | 145 s> Content-Type: application/mercurial-cbor\r\n |
146 s> Content-Length: *\r\n (glob) | 146 s> Content-Length: *\r\n (glob) |
147 s> \r\n | 147 s> \r\n |
148 s> \xa3GapibaseDapi/Dapis\xa0Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 | 148 s> \xa3GapibaseDapi/Dapis\xa0Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 |
149 cbor> { | 149 cbor> [ |
150 b'apibase': b'api/', | 150 { |
151 b'apis': {}, | 151 b'apibase': b'api/', |
152 b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS$ 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' | 152 b'apis': {}, |
153 } | 153 b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS$ 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' |
154 } | |
155 ] | |
154 | 156 |
155 Restart server to enable HTTPv2 | 157 Restart server to enable HTTPv2 |
156 | 158 |
157 $ killdaemons.py | 159 $ killdaemons.py |
158 $ enablehttpv2 server | 160 $ enablehttpv2 server |
181 s> Date: $HTTP_DATE$\r\n | 183 s> Date: $HTTP_DATE$\r\n |
182 s> Content-Type: application/mercurial-cbor\r\n | 184 s> Content-Type: application/mercurial-cbor\r\n |
183 s> Content-Length: *\r\n (glob) | 185 s> Content-Length: *\r\n (glob) |
184 s> \r\n | 186 s> \r\n |
185 s> \xa3GapibaseDapi/Dapis\xa0Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 | 187 s> \xa3GapibaseDapi/Dapis\xa0Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 |
186 cbor> { | 188 cbor> [ |
187 b'apibase': b'api/', | 189 { |
188 b'apis': {}, | 190 b'apibase': b'api/', |
189 b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS$ 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' | 191 b'apis': {}, |
190 } | 192 b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS$ 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 } | |
194 ] | |
191 | 195 |
192 Request for HTTPv2 service returns information about it | 196 Request for HTTPv2 service returns information about it |
193 | 197 |
194 $ sendhttpraw << EOF | 198 $ sendhttpraw << EOF |
195 > httprequest GET ?cmd=capabilities | 199 > httprequest GET ?cmd=capabilities |
211 s> Date: $HTTP_DATE$\r\n | 215 s> Date: $HTTP_DATE$\r\n |
212 s> Content-Type: application/mercurial-cbor\r\n | 216 s> Content-Type: application/mercurial-cbor\r\n |
213 s> Content-Length: *\r\n (glob) | 217 s> Content-Length: *\r\n (glob) |
214 s> \r\n | 218 s> \r\n |
215 s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0002\xa5Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84IbookmarksGparentsEphaseHrevisionInoderange\xa3Gdefault\xf6Hrequired\xf4DtypeDlistEnodes\xa3Gdefault\xf6Hrequired\xf4DtypeDlistJnodesdepth\xa3Gdefault\xf6Hrequired\xf4DtypeCintKpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDpath\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xa3Gdefault\xf4Hrequired\xf4DtypeDboolKpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\xa3Gdefault\x80Hrequired\xf4DtypeDlistKpermissions\x81DpullHlistkeys\xa2Dargs\xa1Inamespace\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullFlookup\xa2Dargs\xa1Ckey\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDtree\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullGpushkey\xa2Dargs\xa4Ckey\xa2Hrequired\xf5DtypeEbytesInamespace\xa2Hrequired\xf5DtypeEbytesCnew\xa2Hrequired\xf5DtypeEbytesCold\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Rpathfilterprefixes\xd9\x01\x02\x82Epath:Lrootfilesin:Nrawrepoformats\x82LgeneraldeltaHrevlogv1Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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 | 219 s> \xa3GapibaseDapi/Dapis\xa1Pexp-http-v2-0002\xa5Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x84IbookmarksGparentsEphaseHrevisionInoderange\xa3Gdefault\xf6Hrequired\xf4DtypeDlistEnodes\xa3Gdefault\xf6Hrequired\xf4DtypeDlistJnodesdepth\xa3Gdefault\xf6Hrequired\xf4DtypeCintKpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDpath\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xa3Gdefault\xf4Hrequired\xf4DtypeDboolKpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\xa3Gdefault\x80Hrequired\xf4DtypeDlistKpermissions\x81DpullHlistkeys\xa2Dargs\xa1Inamespace\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullFlookup\xa2Dargs\xa1Ckey\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\xa4Gdefault\xd9\x01\x02\x80Hrequired\xf4DtypeCsetKvalidvalues\xd9\x01\x02\x82GparentsHrevisionKhaveparents\xa3Gdefault\xf4Hrequired\xf4DtypeDboolEnodes\xa2Hrequired\xf5DtypeDlistDtree\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpullGpushkey\xa2Dargs\xa4Ckey\xa2Hrequired\xf5DtypeEbytesInamespace\xa2Hrequired\xf5DtypeEbytesCnew\xa2Hrequired\xf5DtypeEbytesCold\xa2Hrequired\xf5DtypeEbytesKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Rpathfilterprefixes\xd9\x01\x02\x82Epath:Lrootfilesin:Nrawrepoformats\x82LgeneraldeltaHrevlogv1Nv1capabilitiesY\x01\xd3batch branchmap $USUAL_BUNDLE2_CAPS$ 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> { | 220 cbor> [ |
217 b'apibase': b'api/', | 221 { |
218 b'apis': { | 222 b'apibase': b'api/', |
219 b'exp-http-v2-0002': { | 223 b'apis': { |
220 b'commands': { | 224 b'exp-http-v2-0002': { |
221 b'branchmap': { | 225 b'commands': { |
222 b'args': {}, | 226 b'branchmap': { |
223 b'permissions': [ | 227 b'args': {}, |
224 b'pull' | 228 b'permissions': [ |
225 ] | 229 b'pull' |
226 }, | 230 ] |
227 b'capabilities': { | 231 }, |
228 b'args': {}, | 232 b'capabilities': { |
229 b'permissions': [ | 233 b'args': {}, |
230 b'pull' | 234 b'permissions': [ |
231 ] | 235 b'pull' |
232 }, | 236 ] |
233 b'changesetdata': { | 237 }, |
234 b'args': { | 238 b'changesetdata': { |
235 b'fields': { | 239 b'args': { |
236 b'default': set([]), | 240 b'fields': { |
237 b'required': False, | 241 b'default': set([]), |
238 b'type': b'set', | 242 b'required': False, |
239 b'validvalues': set([ | 243 b'type': b'set', |
240 b'bookmarks', | 244 b'validvalues': set([ |
241 b'parents', | 245 b'bookmarks', |
242 b'phase', | 246 b'parents', |
243 b'revision' | 247 b'phase', |
244 ]) | 248 b'revision' |
245 }, | 249 ]) |
246 b'noderange': { | 250 }, |
247 b'default': None, | 251 b'noderange': { |
248 b'required': False, | 252 b'default': None, |
249 b'type': b'list' | 253 b'required': False, |
250 }, | 254 b'type': b'list' |
251 b'nodes': { | 255 }, |
252 b'default': None, | 256 b'nodes': { |
253 b'required': False, | 257 b'default': None, |
254 b'type': b'list' | 258 b'required': False, |
255 }, | 259 b'type': b'list' |
256 b'nodesdepth': { | 260 }, |
257 b'default': None, | 261 b'nodesdepth': { |
258 b'required': False, | 262 b'default': None, |
259 b'type': b'int' | 263 b'required': False, |
260 } | 264 b'type': b'int' |
261 }, | 265 } |
262 b'permissions': [ | 266 }, |
263 b'pull' | 267 b'permissions': [ |
264 ] | 268 b'pull' |
265 }, | 269 ] |
266 b'filedata': { | 270 }, |
267 b'args': { | 271 b'filedata': { |
268 b'fields': { | 272 b'args': { |
269 b'default': set([]), | 273 b'fields': { |
270 b'required': False, | 274 b'default': set([]), |
271 b'type': b'set', | 275 b'required': False, |
272 b'validvalues': set([ | 276 b'type': b'set', |
273 b'parents', | 277 b'validvalues': set([ |
274 b'revision' | 278 b'parents', |
275 ]) | 279 b'revision' |
276 }, | 280 ]) |
277 b'haveparents': { | 281 }, |
278 b'default': False, | 282 b'haveparents': { |
279 b'required': False, | 283 b'default': False, |
280 b'type': b'bool' | 284 b'required': False, |
281 }, | 285 b'type': b'bool' |
282 b'nodes': { | 286 }, |
283 b'required': True, | 287 b'nodes': { |
284 b'type': b'list' | 288 b'required': True, |
285 }, | 289 b'type': b'list' |
286 b'path': { | 290 }, |
287 b'required': True, | 291 b'path': { |
288 b'type': b'bytes' | 292 b'required': True, |
289 } | 293 b'type': b'bytes' |
290 }, | 294 } |
291 b'permissions': [ | 295 }, |
292 b'pull' | 296 b'permissions': [ |
293 ] | 297 b'pull' |
294 }, | 298 ] |
295 b'heads': { | 299 }, |
296 b'args': { | 300 b'heads': { |
297 b'publiconly': { | 301 b'args': { |
298 b'default': False, | 302 b'publiconly': { |
299 b'required': False, | 303 b'default': False, |
300 b'type': b'bool' | 304 b'required': False, |
301 } | 305 b'type': b'bool' |
302 }, | 306 } |
303 b'permissions': [ | 307 }, |
304 b'pull' | 308 b'permissions': [ |
305 ] | 309 b'pull' |
306 }, | 310 ] |
307 b'known': { | 311 }, |
308 b'args': { | 312 b'known': { |
309 b'nodes': { | 313 b'args': { |
310 b'default': [], | 314 b'nodes': { |
311 b'required': False, | 315 b'default': [], |
312 b'type': b'list' | 316 b'required': False, |
313 } | 317 b'type': b'list' |
314 }, | 318 } |
315 b'permissions': [ | 319 }, |
316 b'pull' | 320 b'permissions': [ |
317 ] | 321 b'pull' |
318 }, | 322 ] |
319 b'listkeys': { | 323 }, |
320 b'args': { | 324 b'listkeys': { |
321 b'namespace': { | 325 b'args': { |
322 b'required': True, | 326 b'namespace': { |
323 b'type': b'bytes' | 327 b'required': True, |
324 } | 328 b'type': b'bytes' |
325 }, | 329 } |
326 b'permissions': [ | 330 }, |
327 b'pull' | 331 b'permissions': [ |
328 ] | 332 b'pull' |
329 }, | 333 ] |
330 b'lookup': { | 334 }, |
331 b'args': { | 335 b'lookup': { |
332 b'key': { | 336 b'args': { |
333 b'required': True, | 337 b'key': { |
334 b'type': b'bytes' | 338 b'required': True, |
335 } | 339 b'type': b'bytes' |
336 }, | 340 } |
337 b'permissions': [ | 341 }, |
338 b'pull' | 342 b'permissions': [ |
339 ] | 343 b'pull' |
340 }, | 344 ] |
341 b'manifestdata': { | 345 }, |
342 b'args': { | 346 b'manifestdata': { |
343 b'fields': { | 347 b'args': { |
344 b'default': set([]), | 348 b'fields': { |
345 b'required': False, | 349 b'default': set([]), |
346 b'type': b'set', | 350 b'required': False, |
347 b'validvalues': set([ | 351 b'type': b'set', |
348 b'parents', | 352 b'validvalues': set([ |
349 b'revision' | 353 b'parents', |
350 ]) | 354 b'revision' |
351 }, | 355 ]) |
352 b'haveparents': { | 356 }, |
353 b'default': False, | 357 b'haveparents': { |
354 b'required': False, | 358 b'default': False, |
355 b'type': b'bool' | 359 b'required': False, |
356 }, | 360 b'type': b'bool' |
357 b'nodes': { | 361 }, |
358 b'required': True, | 362 b'nodes': { |
359 b'type': b'list' | 363 b'required': True, |
360 }, | 364 b'type': b'list' |
361 b'tree': { | 365 }, |
362 b'required': True, | 366 b'tree': { |
363 b'type': b'bytes' | 367 b'required': True, |
364 } | 368 b'type': b'bytes' |
365 }, | 369 } |
366 b'permissions': [ | 370 }, |
367 b'pull' | 371 b'permissions': [ |
368 ] | 372 b'pull' |
369 }, | 373 ] |
370 b'pushkey': { | 374 }, |
371 b'args': { | 375 b'pushkey': { |
372 b'key': { | 376 b'args': { |
373 b'required': True, | 377 b'key': { |
374 b'type': b'bytes' | 378 b'required': True, |
375 }, | 379 b'type': b'bytes' |
376 b'namespace': { | 380 }, |
377 b'required': True, | 381 b'namespace': { |
378 b'type': b'bytes' | 382 b'required': True, |
379 }, | 383 b'type': b'bytes' |
380 b'new': { | 384 }, |
381 b'required': True, | 385 b'new': { |
382 b'type': b'bytes' | 386 b'required': True, |
383 }, | 387 b'type': b'bytes' |
384 b'old': { | 388 }, |
385 b'required': True, | 389 b'old': { |
386 b'type': b'bytes' | 390 b'required': True, |
387 } | 391 b'type': b'bytes' |
388 }, | 392 } |
389 b'permissions': [ | 393 }, |
390 b'push' | 394 b'permissions': [ |
391 ] | 395 b'push' |
392 } | 396 ] |
393 }, | 397 } |
394 b'compression': [ | 398 }, |
395 { | 399 b'compression': [ |
396 b'name': b'zlib' | 400 { |
397 } | 401 b'name': b'zlib' |
398 ], | 402 } |
399 b'framingmediatypes': [ | 403 ], |
400 b'application/mercurial-exp-framing-0005' | 404 b'framingmediatypes': [ |
401 ], | 405 b'application/mercurial-exp-framing-0005' |
402 b'pathfilterprefixes': set([ | 406 ], |
403 b'path:', | 407 b'pathfilterprefixes': set([ |
404 b'rootfilesin:' | 408 b'path:', |
405 ]), | 409 b'rootfilesin:' |
406 b'rawrepoformats': [ | 410 ]), |
407 b'generaldelta', | 411 b'rawrepoformats': [ |
408 b'revlogv1' | 412 b'generaldelta', |
409 ] | 413 b'revlogv1' |
410 } | 414 ] |
411 }, | 415 } |
412 b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS$ 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' | 416 }, |
413 } | 417 b'v1capabilities': b'batch branchmap $USUAL_BUNDLE2_CAPS$ 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' |
418 } | |
419 ] | |
414 | 420 |
415 capabilities command returns expected info | 421 capabilities command returns expected info |
416 | 422 |
417 $ sendhttpv2peerhandshake << EOF | 423 $ sendhttpv2peerhandshake << EOF |
418 > command capabilities | 424 > command capabilities |