Show More
@@ -283,6 +283,7 b' def _fetchmanifests(repo, tr, remote, ma' | |||||
283 | b'tree': b'', |
|
283 | b'tree': b'', | |
284 | b'nodes': batch, |
|
284 | b'nodes': batch, | |
285 | b'fields': {b'parents', b'revision'}, |
|
285 | b'fields': {b'parents', b'revision'}, | |
|
286 | b'haveparents': True, | |||
286 | }).result() |
|
287 | }).result() | |
287 |
|
288 | |||
288 | # Chomp off header object. |
|
289 | # Chomp off header object. | |
@@ -374,7 +375,8 b' def _fetchfiles(repo, tr, remote, fnodes' | |||||
374 | fs.append((path, e.callcommand(b'filedata', { |
|
375 | fs.append((path, e.callcommand(b'filedata', { | |
375 | b'path': path, |
|
376 | b'path': path, | |
376 | b'nodes': sorted(nodes), |
|
377 | b'nodes': sorted(nodes), | |
377 | b'fields': {b'parents', b'revision'} |
|
378 | b'fields': {b'parents', b'revision'}, | |
|
379 | b'haveparents': True, | |||
378 | }))) |
|
380 | }))) | |
379 |
|
381 | |||
380 | locallinkrevs[path] = { |
|
382 | locallinkrevs[path] = { |
@@ -213,6 +213,14 b' fields' | |||||
213 | revision |
|
213 | revision | |
214 | The raw revision data for a file. |
|
214 | The raw revision data for a file. | |
215 |
|
215 | |||
|
216 | haveparents | |||
|
217 | (bool) Whether the client has the parent revisions of all requested | |||
|
218 | nodes. If set, the server may emit revision data as deltas against | |||
|
219 | any parent revision. If not set, the server MUST only emit deltas for | |||
|
220 | revisions previously emitted by this command. | |||
|
221 | ||||
|
222 | False is assumed in the absence of any value. | |||
|
223 | ||||
216 | nodes |
|
224 | nodes | |
217 | (array of bytestrings) File nodes whose data to retrieve. |
|
225 | (array of bytestrings) File nodes whose data to retrieve. | |
218 |
|
226 | |||
@@ -349,6 +357,14 b' fields' | |||||
349 | revision |
|
357 | revision | |
350 | The raw revision data for the manifest. |
|
358 | The raw revision data for the manifest. | |
351 |
|
359 | |||
|
360 | haveparents | |||
|
361 | (bool) Whether the client has the parent revisions of all requested | |||
|
362 | nodes. If set, the server may emit revision data as deltas against | |||
|
363 | any parent revision. If not set, the server MUST only emit deltas for | |||
|
364 | revisions previously emitted by this command. | |||
|
365 | ||||
|
366 | False is assumed in the absence of any value. | |||
|
367 | ||||
352 | nodes |
|
368 | nodes | |
353 | (array of bytestring) Manifest nodes whose data to retrieve. |
|
369 | (array of bytestring) Manifest nodes whose data to retrieve. | |
354 |
|
370 | |||
@@ -361,7 +377,6 b' TODO allow specifying revisions via alte' | |||||
361 | revisions or ranges) |
|
377 | revisions or ranges) | |
362 | TODO consider recursive expansion of manifests (with path filtering for |
|
378 | TODO consider recursive expansion of manifests (with path filtering for | |
363 | narrow use cases) |
|
379 | narrow use cases) | |
364 | TODO more control over whether to emit fulltexts or deltas |
|
|||
365 |
|
380 | |||
366 | The response bytestream starts with a CBOR map describing the data that |
|
381 | The response bytestream starts with a CBOR map describing the data that | |
367 | follows. It has the following bytestring keys: |
|
382 | follows. It has the following bytestring keys: |
@@ -415,7 +415,7 b' def _capabilitiesv2(repo, proto):' | |||||
415 |
|
415 | |||
416 | return proto.addcapabilities(repo, caps) |
|
416 | return proto.addcapabilities(repo, caps) | |
417 |
|
417 | |||
418 | def builddeltarequests(store, nodes): |
|
418 | def builddeltarequests(store, nodes, haveparents): | |
419 | """Build a series of revision delta requests against a backend store. |
|
419 | """Build a series of revision delta requests against a backend store. | |
420 |
|
420 | |||
421 | Returns a list of revision numbers in the order they should be sent |
|
421 | Returns a list of revision numbers in the order they should be sent | |
@@ -430,50 +430,69 b' def builddeltarequests(store, nodes):' | |||||
430 | revs = dagop.linearize({store.rev(n) for n in nodes}, store.parentrevs) |
|
430 | revs = dagop.linearize({store.rev(n) for n in nodes}, store.parentrevs) | |
431 |
|
431 | |||
432 | requests = [] |
|
432 | requests = [] | |
|
433 | seenrevs = set() | |||
433 |
|
434 | |||
434 | for rev in revs: |
|
435 | for rev in revs: | |
435 | node = store.node(rev) |
|
436 | node = store.node(rev) | |
436 | parents = store.parents(node) |
|
437 | parentnodes = store.parents(node) | |
437 | deltaparent = store.node(store.deltaparent(rev)) |
|
438 | parentrevs = [store.rev(n) for n in parentnodes] | |
|
439 | deltabaserev = store.deltaparent(rev) | |||
|
440 | deltabasenode = store.node(deltabaserev) | |||
438 |
|
441 | |||
439 | # There is a delta in storage. That means we can send the delta |
|
442 | # The choice of whether to send a fulltext revision or a delta and | |
440 | # efficiently. |
|
443 | # what delta to send is governed by a few factors. | |
441 | # |
|
444 | # | |
442 | # But, the delta may be against a revision the receiver doesn't |
|
445 | # To send a delta, we need to ensure the receiver is capable of | |
443 | # have (e.g. shallow clone or when the delta isn't against a parent |
|
446 | # decoding it. And that requires the receiver to have the base | |
444 | # revision). For now, we ignore the problem of shallow clone. As |
|
447 | # revision the delta is against. | |
445 | # long as a delta exists against a parent, we send it. |
|
448 | # | |
446 | # TODO allow arguments to control this behavior, as the receiver |
|
449 | # We can only guarantee the receiver has the base revision if | |
447 | # may not have the base revision in some scenarios. |
|
450 | # a) we've already sent the revision as part of this group | |
448 | if deltaparent != nullid and deltaparent in parents: |
|
451 | # b) the receiver has indicated they already have the revision. | |
449 | basenode = deltaparent |
|
452 | # And the mechanism for "b" is the client indicating they have | |
|
453 | # parent revisions. So this means we can only send the delta if | |||
|
454 | # it is sent before or it is against a delta and the receiver says | |||
|
455 | # they have a parent. | |||
450 |
|
456 | |||
451 | # Else there is no delta parent in storage or the delta that is |
|
457 | # We can send storage delta if it is against a revision we've sent | |
452 | # # there isn't suitable. Let's use a delta against a parent |
|
458 | # in this group. | |
453 | # revision, if possible. |
|
459 | if deltabaserev != nullrev and deltabaserev in seenrevs: | |
454 | # |
|
460 | basenode = deltabasenode | |
455 | # There is room to check if the delta parent is in the ancestry of |
|
461 | ||
456 | # this node. But there isn't an API on the manifest storage object |
|
462 | # We can send storage delta if it is against a parent revision and | |
457 | # for that. So ignore this case for now. |
|
463 | # the receiver indicates they have the parents. | |
|
464 | elif (deltabaserev != nullrev and deltabaserev in parentrevs | |||
|
465 | and haveparents): | |||
|
466 | basenode = deltabasenode | |||
458 |
|
467 | |||
459 | elif parents[0] != nullid: |
|
468 | # Otherwise the storage delta isn't appropriate. Fall back to | |
460 | basenode = parents[0] |
|
469 | # using another delta, if possible. | |
461 | elif parents[1] != nullid: |
|
|||
462 | basenode = parents[1] |
|
|||
463 |
|
470 | |||
464 | # No potential bases to delta against. Send a full revision. |
|
471 | # Use p1 if we've emitted it or receiver says they have it. | |
|
472 | elif parentrevs[0] != nullrev and ( | |||
|
473 | parentrevs[0] in seenrevs or haveparents): | |||
|
474 | basenode = parentnodes[0] | |||
|
475 | ||||
|
476 | # Use p2 if we've emitted it or receiver says they have it. | |||
|
477 | elif parentrevs[1] != nullrev and ( | |||
|
478 | parentrevs[1] in seenrevs or haveparents): | |||
|
479 | basenode = parentnodes[1] | |||
|
480 | ||||
|
481 | # Nothing appropriate to delta against. Send the full revision. | |||
465 | else: |
|
482 | else: | |
466 | basenode = nullid |
|
483 | basenode = nullid | |
467 |
|
484 | |||
468 | requests.append(changegroup.revisiondeltarequest( |
|
485 | requests.append(changegroup.revisiondeltarequest( | |
469 | node=node, |
|
486 | node=node, | |
470 | p1node=parents[0], |
|
487 | p1node=parentnodes[0], | |
471 | p2node=parents[1], |
|
488 | p2node=parentnodes[1], | |
472 | # Receiver deals with linknode resolution. |
|
489 | # Receiver deals with linknode resolution. | |
473 | linknode=nullid, |
|
490 | linknode=nullid, | |
474 | basenode=basenode, |
|
491 | basenode=basenode, | |
475 | )) |
|
492 | )) | |
476 |
|
493 | |||
|
494 | seenrevs.add(rev) | |||
|
495 | ||||
477 | return revs, requests |
|
496 | return revs, requests | |
478 |
|
497 | |||
479 | def wireprotocommand(name, args=None, permission='push'): |
|
498 | def wireprotocommand(name, args=None, permission='push'): | |
@@ -674,12 +693,14 b' def getfilestore(repo, proto, path):' | |||||
674 |
|
693 | |||
675 | @wireprotocommand('filedata', |
|
694 | @wireprotocommand('filedata', | |
676 | args={ |
|
695 | args={ | |
|
696 | 'haveparents': True, | |||
677 | 'nodes': [b'0123456...'], |
|
697 | 'nodes': [b'0123456...'], | |
678 | 'fields': [b'parents', b'revision'], |
|
698 | 'fields': [b'parents', b'revision'], | |
679 | 'path': b'foo.txt', |
|
699 | 'path': b'foo.txt', | |
680 | }, |
|
700 | }, | |
681 | permission='pull') |
|
701 | permission='pull') | |
682 |
def filedata(repo, proto, nodes=None, fields=None, |
|
702 | def filedata(repo, proto, haveparents=False, nodes=None, fields=None, | |
|
703 | path=None): | |||
683 | fields = fields or set() |
|
704 | fields = fields or set() | |
684 |
|
705 | |||
685 | if nodes is None: |
|
706 | if nodes is None: | |
@@ -702,7 +723,7 b' def filedata(repo, proto, nodes=None, fi' | |||||
702 | raise error.WireprotoCommandError('unknown file node: %s', |
|
723 | raise error.WireprotoCommandError('unknown file node: %s', | |
703 | (hex(node),)) |
|
724 | (hex(node),)) | |
704 |
|
725 | |||
705 | revs, requests = builddeltarequests(store, nodes) |
|
726 | revs, requests = builddeltarequests(store, nodes, haveparents) | |
706 |
|
727 | |||
707 | yield { |
|
728 | yield { | |
708 | b'totalitems': len(revs), |
|
729 | b'totalitems': len(revs), | |
@@ -804,11 +825,13 b' def lookupv2(repo, proto, key):' | |||||
804 | @wireprotocommand('manifestdata', |
|
825 | @wireprotocommand('manifestdata', | |
805 | args={ |
|
826 | args={ | |
806 | 'nodes': [b'0123456...'], |
|
827 | 'nodes': [b'0123456...'], | |
|
828 | 'haveparents': True, | |||
807 | 'fields': [b'parents', b'revision'], |
|
829 | 'fields': [b'parents', b'revision'], | |
808 | 'tree': b'', |
|
830 | 'tree': b'', | |
809 | }, |
|
831 | }, | |
810 | permission='pull') |
|
832 | permission='pull') | |
811 |
def manifestdata(repo, proto, nodes=None, fields=None, |
|
833 | def manifestdata(repo, proto, haveparents=False, nodes=None, fields=None, | |
|
834 | tree=None): | |||
812 | fields = fields or set() |
|
835 | fields = fields or set() | |
813 |
|
836 | |||
814 | if nodes is None: |
|
837 | if nodes is None: | |
@@ -829,7 +852,7 b' def manifestdata(repo, proto, nodes=None' | |||||
829 | raise error.WireprotoCommandError( |
|
852 | raise error.WireprotoCommandError( | |
830 | 'unknown node: %s', (node,)) |
|
853 | 'unknown node: %s', (node,)) | |
831 |
|
854 | |||
832 | revs, requests = builddeltarequests(store, nodes) |
|
855 | revs, requests = builddeltarequests(store, nodes, haveparents) | |
833 |
|
856 | |||
834 | yield { |
|
857 | yield { | |
835 | b'totalitems': len(revs), |
|
858 | b'totalitems': len(revs), |
@@ -313,7 +313,7 b' 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\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\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\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\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 b' 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\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\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\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\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': { | |
@@ -258,6 +258,7 b' Request for HTTPv2 service returns infor' | |||||
258 | b'parents', |
|
258 | b'parents', | |
259 | b'revision' |
|
259 | b'revision' | |
260 | ], |
|
260 | ], | |
|
261 | b'haveparents': True, | |||
261 | b'nodes': [ |
|
262 | b'nodes': [ | |
262 | b'0123456...' |
|
263 | b'0123456...' | |
263 | ], |
|
264 | ], | |
@@ -307,6 +308,7 b' Request for HTTPv2 service returns infor' | |||||
307 | b'parents', |
|
308 | b'parents', | |
308 | b'revision' |
|
309 | b'revision' | |
309 | ], |
|
310 | ], | |
|
311 | b'haveparents': True, | |||
310 | b'nodes': [ |
|
312 | b'nodes': [ | |
311 | b'0123456...' |
|
313 | b'0123456...' | |
312 | ], |
|
314 | ], | |
@@ -367,7 +369,7 b' capabilities command returns expected in' | |||||
367 | s> Content-Type: application/mercurial-cbor\r\n |
|
369 | s> Content-Type: application/mercurial-cbor\r\n | |
368 | s> Content-Length: *\r\n (glob) |
|
370 | s> Content-Length: *\r\n (glob) | |
369 | s> \r\n |
|
371 | s> \r\n | |
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\xa |
|
372 | 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\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\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 | |
371 | sending capabilities command |
|
373 | sending capabilities command | |
372 | s> POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n |
|
374 | s> POST /api/exp-http-v2-0001/ro/capabilities HTTP/1.1\r\n | |
373 | s> Accept-Encoding: identity\r\n |
|
375 | s> Accept-Encoding: identity\r\n | |
@@ -390,11 +392,11 b' capabilities command returns expected in' | |||||
390 | s> \xa1FstatusBok |
|
392 | s> \xa1FstatusBok | |
391 | s> \r\n |
|
393 | s> \r\n | |
392 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) |
|
394 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |
393 |
s> |
|
395 | s> 30e\r\n | |
394 |
s> \x |
|
396 | s> \x06\x03\x00\x01\x00\x02\x001 | |
395 |
s> \xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa |
|
397 | s> \xa4Hcommands\xaaIbranchmap\xa2Dargs\xa0Kpermissions\x81DpullLcapabilities\xa2Dargs\xa0Kpermissions\x81DpullMchangesetdata\xa2Dargs\xa3Ffields\xd9\x01\x02\x82GparentsHrevisionInoderange\x82\x81J0123456...\x81Iabcdef...Enodes\x81J0123456...Kpermissions\x81DpullHfiledata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...DpathGfoo.txtKpermissions\x81DpullEheads\xa2Dargs\xa1Jpubliconly\xf4Kpermissions\x81DpullEknown\xa2Dargs\xa1Enodes\x81HdeadbeefKpermissions\x81DpullHlistkeys\xa2Dargs\xa1InamespaceBnsKpermissions\x81DpullFlookup\xa2Dargs\xa1CkeyCfooKpermissions\x81DpullLmanifestdata\xa2Dargs\xa4Ffields\x82GparentsHrevisionKhaveparents\xf5Enodes\x81J0123456...Dtree@Kpermissions\x81DpullGpushkey\xa2Dargs\xa4CkeyCkeyInamespaceBnsCnewCnewColdColdKpermissions\x81DpushKcompression\x81\xa1DnameDzlibQframingmediatypes\x81X&application/mercurial-exp-framing-0005Nrawrepoformats\x82LgeneraldeltaHrevlogv1 | |
396 | s> \r\n |
|
398 | s> \r\n | |
397 |
received frame(size=74 |
|
399 | received frame(size=774; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |
398 | s> 8\r\n |
|
400 | s> 8\r\n | |
399 | s> \x00\x00\x00\x01\x00\x02\x002 |
|
401 | s> \x00\x00\x00\x01\x00\x02\x002 | |
400 | s> \r\n |
|
402 | s> \r\n | |
@@ -444,6 +446,7 b' capabilities command returns expected in' | |||||
444 | b'parents', |
|
446 | b'parents', | |
445 | b'revision' |
|
447 | b'revision' | |
446 | ], |
|
448 | ], | |
|
449 | b'haveparents': True, | |||
447 | b'nodes': [ |
|
450 | b'nodes': [ | |
448 | b'0123456...' |
|
451 | b'0123456...' | |
449 | ], |
|
452 | ], | |
@@ -493,6 +496,7 b' capabilities command returns expected in' | |||||
493 | b'parents', |
|
496 | b'parents', | |
494 | b'revision' |
|
497 | b'revision' | |
495 | ], |
|
498 | ], | |
|
499 | b'haveparents': True, | |||
496 | b'nodes': [ |
|
500 | b'nodes': [ | |
497 | b'0123456...' |
|
501 | b'0123456...' | |
498 | ], |
|
502 | ], |
@@ -253,6 +253,7 b' Requesting parents works' | |||||
253 | ] |
|
253 | ] | |
254 |
|
254 | |||
255 | Requesting revision data works |
|
255 | Requesting revision data works | |
|
256 | (haveparents defaults to False, so fulltext is emitted) | |||
256 |
|
257 | |||
257 | $ sendhttpv2peer << EOF |
|
258 | $ sendhttpv2peer << EOF | |
258 | > command filedata |
|
259 | > command filedata | |
@@ -283,6 +284,114 b' Requesting revision data works' | |||||
283 | s> \xa1FstatusBok |
|
284 | s> \xa1FstatusBok | |
284 | s> \r\n |
|
285 | s> \r\n | |
285 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) |
|
286 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |
|
287 | s> 42\r\n | |||
|
288 | s> :\x00\x00\x01\x00\x02\x001 | |||
|
289 | s> \xa1Jtotalitems\x01\xa2DnodeT\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccLrevisionsize\x03Ca1\n | |||
|
290 | s> \r\n | |||
|
291 | received frame(size=58; 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'node': b'\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc', | |||
|
304 | b'revisionsize': 3 | |||
|
305 | }, | |||
|
306 | b'a1\n' | |||
|
307 | ] | |||
|
308 | ||||
|
309 | haveparents=False should be same as above | |||
|
310 | ||||
|
311 | $ sendhttpv2peer << EOF | |||
|
312 | > command filedata | |||
|
313 | > nodes eval:[b'\x9a\x38\x12\x29\x97\xb3\xac\x97\xbe\x2a\x9a\xa2\xe5\x56\x83\x83\x41\xfd\xf2\xcc'] | |||
|
314 | > path eval:b'a' | |||
|
315 | > fields eval:[b'revision'] | |||
|
316 | > haveparents eval:False | |||
|
317 | > EOF | |||
|
318 | creating http peer for wire protocol version 2 | |||
|
319 | sending filedata command | |||
|
320 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
321 | s> Accept-Encoding: identity\r\n | |||
|
322 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
323 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
324 | s> content-length: 94\r\n | |||
|
325 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
326 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
327 | s> \r\n | |||
|
328 | s> V\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa4Ffields\x81HrevisionKhaveparents\xf4Enodes\x81T\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccDpathAaDnameHfiledata | |||
|
329 | s> makefile('rb', None) | |||
|
330 | s> HTTP/1.1 200 OK\r\n | |||
|
331 | s> Server: testing stub value\r\n | |||
|
332 | s> Date: $HTTP_DATE$\r\n | |||
|
333 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
334 | s> Transfer-Encoding: chunked\r\n | |||
|
335 | s> \r\n | |||
|
336 | s> 13\r\n | |||
|
337 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
338 | s> \xa1FstatusBok | |||
|
339 | s> \r\n | |||
|
340 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
|
341 | s> 42\r\n | |||
|
342 | s> :\x00\x00\x01\x00\x02\x001 | |||
|
343 | s> \xa1Jtotalitems\x01\xa2DnodeT\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccLrevisionsize\x03Ca1\n | |||
|
344 | s> \r\n | |||
|
345 | received frame(size=58; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |||
|
346 | s> 8\r\n | |||
|
347 | s> \x00\x00\x00\x01\x00\x02\x002 | |||
|
348 | s> \r\n | |||
|
349 | s> 0\r\n | |||
|
350 | s> \r\n | |||
|
351 | received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) | |||
|
352 | response: gen[ | |||
|
353 | { | |||
|
354 | b'totalitems': 1 | |||
|
355 | }, | |||
|
356 | { | |||
|
357 | b'node': b'\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc', | |||
|
358 | b'revisionsize': 3 | |||
|
359 | }, | |||
|
360 | b'a1\n' | |||
|
361 | ] | |||
|
362 | ||||
|
363 | haveparents=True should emit a delta | |||
|
364 | ||||
|
365 | $ sendhttpv2peer << EOF | |||
|
366 | > command filedata | |||
|
367 | > nodes eval:[b'\x9a\x38\x12\x29\x97\xb3\xac\x97\xbe\x2a\x9a\xa2\xe5\x56\x83\x83\x41\xfd\xf2\xcc'] | |||
|
368 | > path eval:b'a' | |||
|
369 | > fields eval:[b'revision'] | |||
|
370 | > haveparents eval:True | |||
|
371 | > EOF | |||
|
372 | creating http peer for wire protocol version 2 | |||
|
373 | sending filedata command | |||
|
374 | s> POST /api/exp-http-v2-0001/ro/filedata HTTP/1.1\r\n | |||
|
375 | s> Accept-Encoding: identity\r\n | |||
|
376 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
377 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
378 | s> content-length: 94\r\n | |||
|
379 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
380 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
381 | s> \r\n | |||
|
382 | s> V\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa4Ffields\x81HrevisionKhaveparents\xf5Enodes\x81T\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xccDpathAaDnameHfiledata | |||
|
383 | s> makefile('rb', None) | |||
|
384 | s> HTTP/1.1 200 OK\r\n | |||
|
385 | s> Server: testing stub value\r\n | |||
|
386 | s> Date: $HTTP_DATE$\r\n | |||
|
387 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
388 | s> Transfer-Encoding: chunked\r\n | |||
|
389 | s> \r\n | |||
|
390 | s> 13\r\n | |||
|
391 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
392 | s> \xa1FstatusBok | |||
|
393 | s> \r\n | |||
|
394 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
286 | s> 6e\r\n |
|
395 | s> 6e\r\n | |
287 | s> f\x00\x00\x01\x00\x02\x001 |
|
396 | s> f\x00\x00\x01\x00\x02\x001 | |
288 | s> \xa1Jtotalitems\x01\xa3MdeltabasenodeT+N\xb0s\x19\xbf\xa0w\xa4\n |
|
397 | s> \xa1Jtotalitems\x01\xa3MdeltabasenodeT+N\xb0s\x19\xbf\xa0w\xa4\n | |
@@ -308,7 +417,7 b' Requesting revision data works' | |||||
308 | ] |
|
417 | ] | |
309 |
|
418 | |||
310 | Requesting multiple revisions works |
|
419 | Requesting multiple revisions works | |
311 |
(first revision s |
|
420 | (first revision is a fulltext since haveparents=False by default) | |
312 |
|
421 | |||
313 | $ sendhttpv2peer << EOF |
|
422 | $ sendhttpv2peer << EOF | |
314 | > command filedata |
|
423 | > command filedata | |
@@ -465,13 +574,12 b' Requesting parents and revision data wor' | |||||
465 | s> \xa1FstatusBok |
|
574 | s> \xa1FstatusBok | |
466 | s> \r\n |
|
575 | s> \r\n | |
467 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) |
|
576 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |
468 |
s> |
|
577 | s> 75\r\n | |
469 |
s> |
|
578 | s> m\x00\x00\x01\x00\x02\x001 | |
470 |
s> \xa1Jtotalitems\x01\xa |
|
579 | s> \xa1Jtotalitems\x01\xa3DnodeT\x08y4^97r)cKB\x0cc\x94T\x15g&\xc6\xb6Gparents\x82T+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 |
|
580 | 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\x00Lrevisionsize\x03Ca2\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 |
|
581 | s> \r\n | |
474 |
received frame(size=1 |
|
582 | received frame(size=109; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |
475 | s> 8\r\n |
|
583 | s> 8\r\n | |
476 | s> \x00\x00\x00\x01\x00\x02\x002 |
|
584 | s> \x00\x00\x00\x01\x00\x02\x002 | |
477 | s> \r\n |
|
585 | s> \r\n | |
@@ -483,15 +591,14 b' Requesting parents and revision data wor' | |||||
483 | b'totalitems': 1 |
|
591 | b'totalitems': 1 | |
484 | }, |
|
592 | }, | |
485 | { |
|
593 | { | |
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', |
|
594 | b'node': b'\x08y4^97r)cKB\x0cc\x94T\x15g&\xc6\xb6', | |
489 | b'parents': [ |
|
595 | b'parents': [ | |
490 | b'+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', |
|
596 | 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' |
|
597 | b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' | |
492 | ] |
|
598 | ], | |
|
599 | b'revisionsize': 3 | |||
493 | }, |
|
600 | }, | |
494 | b'\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03a2\n' |
|
601 | b'a2\n' | |
495 | ] |
|
602 | ] | |
496 |
|
603 | |||
497 | $ cat error.log |
|
604 | $ cat error.log |
@@ -248,6 +248,7 b' Requesting parents works' | |||||
248 | ] |
|
248 | ] | |
249 |
|
249 | |||
250 | Requesting revision data works |
|
250 | Requesting revision data works | |
|
251 | (haveparents defaults to false, so fulltext is emitted) | |||
251 |
|
252 | |||
252 | $ sendhttpv2peer << EOF |
|
253 | $ sendhttpv2peer << EOF | |
253 | > command manifestdata |
|
254 | > command manifestdata | |
@@ -278,6 +279,124 b' Requesting revision data works' | |||||
278 | s> \xa1FstatusBok |
|
279 | s> \xa1FstatusBok | |
279 | s> \r\n |
|
280 | s> \r\n | |
280 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) |
|
281 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |
|
282 | s> 167\r\n | |||
|
283 | s> _\x01\x00\x01\x00\x02\x001 | |||
|
284 | s> \xa1Jtotalitems\x01\xa2DnodeTF\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0Lrevisionsize\x19\x01$Y\x01$a\x000879345e39377229634b420c639454156726c6b6\n | |||
|
285 | s> b\x00819e258d31a5e1606629f365bb902a1b21ee4216\n | |||
|
286 | s> dir0/c\x00914445346a0ca0629bd47ceb5dfe07e4d4cf2501\n | |||
|
287 | s> dir0/child0/e\x00bbba6c06b30f443d34ff841bc985c4d0827c6be4\n | |||
|
288 | s> dir0/child1/f\x0012fc7dcd773b5a0a929ce195228083c6ddc9cec4\n | |||
|
289 | s> dir0/d\x00538206dc971e521540d6843abfe6d16032f6d426\n | |||
|
290 | s> \r\n | |||
|
291 | received frame(size=351; 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'node': b'F\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0', | |||
|
304 | b'revisionsize': 292 | |||
|
305 | }, | |||
|
306 | b'a\x000879345e39377229634b420c639454156726c6b6\nb\x00819e258d31a5e1606629f365bb902a1b21ee4216\ndir0/c\x00914445346a0ca0629bd47ceb5dfe07e4d4cf2501\ndir0/child0/e\x00bbba6c06b30f443d34ff841bc985c4d0827c6be4\ndir0/child1/f\x0012fc7dcd773b5a0a929ce195228083c6ddc9cec4\ndir0/d\x00538206dc971e521540d6843abfe6d16032f6d426\n' | |||
|
307 | ] | |||
|
308 | ||||
|
309 | haveparents=False yields same output | |||
|
310 | ||||
|
311 | $ sendhttpv2peer << EOF | |||
|
312 | > command manifestdata | |||
|
313 | > nodes eval:[b'\x46\xa6\x72\x1b\x5e\xda\xf0\xea\x04\xb7\x9a\x5c\xb3\x21\x88\x54\xa4\xd2\xab\xa0'] | |||
|
314 | > tree eval:b'' | |||
|
315 | > fields eval:[b'revision'] | |||
|
316 | > haveparents eval:False | |||
|
317 | > EOF | |||
|
318 | creating http peer for wire protocol version 2 | |||
|
319 | sending manifestdata command | |||
|
320 | s> POST /api/exp-http-v2-0001/ro/manifestdata HTTP/1.1\r\n | |||
|
321 | s> Accept-Encoding: identity\r\n | |||
|
322 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
323 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
324 | s> content-length: 97\r\n | |||
|
325 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
326 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
327 | s> \r\n | |||
|
328 | s> Y\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa4Ffields\x81HrevisionKhaveparents\xf4Enodes\x81TF\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0Dtree@DnameLmanifestdata | |||
|
329 | s> makefile('rb', None) | |||
|
330 | s> HTTP/1.1 200 OK\r\n | |||
|
331 | s> Server: testing stub value\r\n | |||
|
332 | s> Date: $HTTP_DATE$\r\n | |||
|
333 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
334 | s> Transfer-Encoding: chunked\r\n | |||
|
335 | s> \r\n | |||
|
336 | s> 13\r\n | |||
|
337 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
338 | s> \xa1FstatusBok | |||
|
339 | s> \r\n | |||
|
340 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
|
341 | s> 167\r\n | |||
|
342 | s> _\x01\x00\x01\x00\x02\x001 | |||
|
343 | s> \xa1Jtotalitems\x01\xa2DnodeTF\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0Lrevisionsize\x19\x01$Y\x01$a\x000879345e39377229634b420c639454156726c6b6\n | |||
|
344 | s> b\x00819e258d31a5e1606629f365bb902a1b21ee4216\n | |||
|
345 | s> dir0/c\x00914445346a0ca0629bd47ceb5dfe07e4d4cf2501\n | |||
|
346 | s> dir0/child0/e\x00bbba6c06b30f443d34ff841bc985c4d0827c6be4\n | |||
|
347 | s> dir0/child1/f\x0012fc7dcd773b5a0a929ce195228083c6ddc9cec4\n | |||
|
348 | s> dir0/d\x00538206dc971e521540d6843abfe6d16032f6d426\n | |||
|
349 | s> \r\n | |||
|
350 | received frame(size=351; 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': 1 | |||
|
360 | }, | |||
|
361 | { | |||
|
362 | b'node': b'F\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0', | |||
|
363 | b'revisionsize': 292 | |||
|
364 | }, | |||
|
365 | b'a\x000879345e39377229634b420c639454156726c6b6\nb\x00819e258d31a5e1606629f365bb902a1b21ee4216\ndir0/c\x00914445346a0ca0629bd47ceb5dfe07e4d4cf2501\ndir0/child0/e\x00bbba6c06b30f443d34ff841bc985c4d0827c6be4\ndir0/child1/f\x0012fc7dcd773b5a0a929ce195228083c6ddc9cec4\ndir0/d\x00538206dc971e521540d6843abfe6d16032f6d426\n' | |||
|
366 | ] | |||
|
367 | ||||
|
368 | haveparents=True will emit delta | |||
|
369 | ||||
|
370 | $ sendhttpv2peer << EOF | |||
|
371 | > command manifestdata | |||
|
372 | > nodes eval:[b'\x46\xa6\x72\x1b\x5e\xda\xf0\xea\x04\xb7\x9a\x5c\xb3\x21\x88\x54\xa4\xd2\xab\xa0'] | |||
|
373 | > tree eval:b'' | |||
|
374 | > fields eval:[b'revision'] | |||
|
375 | > haveparents eval:True | |||
|
376 | > EOF | |||
|
377 | creating http peer for wire protocol version 2 | |||
|
378 | sending manifestdata command | |||
|
379 | s> POST /api/exp-http-v2-0001/ro/manifestdata HTTP/1.1\r\n | |||
|
380 | s> Accept-Encoding: identity\r\n | |||
|
381 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
382 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
383 | s> content-length: 97\r\n | |||
|
384 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
385 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
386 | s> \r\n | |||
|
387 | s> Y\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa4Ffields\x81HrevisionKhaveparents\xf5Enodes\x81TF\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0Dtree@DnameLmanifestdata | |||
|
388 | s> makefile('rb', None) | |||
|
389 | s> HTTP/1.1 200 OK\r\n | |||
|
390 | s> Server: testing stub value\r\n | |||
|
391 | s> Date: $HTTP_DATE$\r\n | |||
|
392 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
393 | s> Transfer-Encoding: chunked\r\n | |||
|
394 | s> \r\n | |||
|
395 | s> 13\r\n | |||
|
396 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
397 | s> \xa1FstatusBok | |||
|
398 | s> \r\n | |||
|
399 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
281 | s> 98\r\n |
|
400 | s> 98\r\n | |
282 | s> \x90\x00\x00\x01\x00\x02\x001 |
|
401 | s> \x90\x00\x00\x01\x00\x02\x001 | |
283 | s> \xa1Jtotalitems\x01\xa3MdeltabasenodeT\x1b\x17[Y_\x02,\xfa\xb5\xb8\t\xcc\x0e\xd5Q\xbd\x0b?\xf5\xe4Ideltasize\x187DnodeTF\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0X7\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n |
|
402 | s> \xa1Jtotalitems\x01\xa3MdeltabasenodeT\x1b\x17[Y_\x02,\xfa\xb5\xb8\t\xcc\x0e\xd5Q\xbd\x0b?\xf5\xe4Ideltasize\x187DnodeTF\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0X7\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n | |
@@ -302,6 +421,8 b' Requesting revision data works' | |||||
302 | ] |
|
421 | ] | |
303 |
|
422 | |||
304 | Requesting multiple revisions works |
|
423 | Requesting multiple revisions works | |
|
424 | (haveparents defaults to false, so fulltext is emitted unless a parent | |||
|
425 | has been emitted) | |||
305 |
|
426 | |||
306 | $ sendhttpv2peer << EOF |
|
427 | $ sendhttpv2peer << EOF | |
307 | > command manifestdata |
|
428 | > command manifestdata | |
@@ -366,6 +487,72 b' Requesting multiple revisions works' | |||||
366 | b'\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n' |
|
487 | b'\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n' | |
367 | ] |
|
488 | ] | |
368 |
|
489 | |||
|
490 | With haveparents=True, first revision is a delta instead of fulltext | |||
|
491 | ||||
|
492 | $ sendhttpv2peer << EOF | |||
|
493 | > command manifestdata | |||
|
494 | > nodes eval:[b'\x1b\x17\x5b\x59\x5f\x02\x2c\xfa\xb5\xb8\x09\xcc\x0e\xd5\x51\xbd\x0b\x3f\xf5\xe4', b'\x46\xa6\x72\x1b\x5e\xda\xf0\xea\x04\xb7\x9a\x5c\xb3\x21\x88\x54\xa4\xd2\xab\xa0'] | |||
|
495 | > tree eval:b'' | |||
|
496 | > fields eval:[b'revision'] | |||
|
497 | > haveparents eval:True | |||
|
498 | > EOF | |||
|
499 | creating http peer for wire protocol version 2 | |||
|
500 | sending manifestdata command | |||
|
501 | s> POST /api/exp-http-v2-0001/ro/manifestdata HTTP/1.1\r\n | |||
|
502 | s> Accept-Encoding: identity\r\n | |||
|
503 | s> accept: application/mercurial-exp-framing-0005\r\n | |||
|
504 | s> content-type: application/mercurial-exp-framing-0005\r\n | |||
|
505 | s> content-length: 118\r\n | |||
|
506 | s> host: $LOCALIP:$HGPORT\r\n (glob) | |||
|
507 | s> user-agent: Mercurial debugwireproto\r\n | |||
|
508 | s> \r\n | |||
|
509 | s> n\x00\x00\x01\x00\x01\x01\x11\xa2Dargs\xa4Ffields\x81HrevisionKhaveparents\xf5Enodes\x82T\x1b\x17[Y_\x02,\xfa\xb5\xb8\t\xcc\x0e\xd5Q\xbd\x0b?\xf5\xe4TF\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0Dtree@DnameLmanifestdata | |||
|
510 | s> makefile('rb', None) | |||
|
511 | s> HTTP/1.1 200 OK\r\n | |||
|
512 | s> Server: testing stub value\r\n | |||
|
513 | s> Date: $HTTP_DATE$\r\n | |||
|
514 | s> Content-Type: application/mercurial-exp-framing-0005\r\n | |||
|
515 | s> Transfer-Encoding: chunked\r\n | |||
|
516 | s> \r\n | |||
|
517 | s> 13\r\n | |||
|
518 | s> \x0b\x00\x00\x01\x00\x02\x011 | |||
|
519 | s> \xa1FstatusBok | |||
|
520 | s> \r\n | |||
|
521 | received frame(size=11; request=1; stream=2; streamflags=stream-begin; type=command-response; flags=continuation) | |||
|
522 | s> 1ea\r\n | |||
|
523 | s> \xe2\x01\x00\x01\x00\x02\x001 | |||
|
524 | s> \xa1Jtotalitems\x02\xa2DnodeT\x1b\x17[Y_\x02,\xfa\xb5\xb8\t\xcc\x0e\xd5Q\xbd\x0b?\xf5\xe4Lrevisionsize\x19\x01$Y\x01$a\x002b4eb07319bfa077a40a2f04913659aef0da42da\n | |||
|
525 | s> b\x00819e258d31a5e1606629f365bb902a1b21ee4216\n | |||
|
526 | s> dir0/c\x00914445346a0ca0629bd47ceb5dfe07e4d4cf2501\n | |||
|
527 | s> dir0/child0/e\x00bbba6c06b30f443d34ff841bc985c4d0827c6be4\n | |||
|
528 | s> dir0/child1/f\x0012fc7dcd773b5a0a929ce195228083c6ddc9cec4\n | |||
|
529 | s> dir0/d\x00538206dc971e521540d6843abfe6d16032f6d426\n | |||
|
530 | s> \xa3MdeltabasenodeT\x1b\x17[Y_\x02,\xfa\xb5\xb8\t\xcc\x0e\xd5Q\xbd\x0b?\xf5\xe4Ideltasize\x187DnodeTF\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0X7\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n | |||
|
531 | s> \r\n | |||
|
532 | received frame(size=482; request=1; stream=2; streamflags=; type=command-response; flags=continuation) | |||
|
533 | s> 8\r\n | |||
|
534 | s> \x00\x00\x00\x01\x00\x02\x002 | |||
|
535 | s> \r\n | |||
|
536 | s> 0\r\n | |||
|
537 | s> \r\n | |||
|
538 | received frame(size=0; request=1; stream=2; streamflags=; type=command-response; flags=eos) | |||
|
539 | response: gen[ | |||
|
540 | { | |||
|
541 | b'totalitems': 2 | |||
|
542 | }, | |||
|
543 | { | |||
|
544 | b'node': b'\x1b\x17[Y_\x02,\xfa\xb5\xb8\t\xcc\x0e\xd5Q\xbd\x0b?\xf5\xe4', | |||
|
545 | b'revisionsize': 292 | |||
|
546 | }, | |||
|
547 | b'a\x002b4eb07319bfa077a40a2f04913659aef0da42da\nb\x00819e258d31a5e1606629f365bb902a1b21ee4216\ndir0/c\x00914445346a0ca0629bd47ceb5dfe07e4d4cf2501\ndir0/child0/e\x00bbba6c06b30f443d34ff841bc985c4d0827c6be4\ndir0/child1/f\x0012fc7dcd773b5a0a929ce195228083c6ddc9cec4\ndir0/d\x00538206dc971e521540d6843abfe6d16032f6d426\n', | |||
|
548 | { | |||
|
549 | b'deltabasenode': b'\x1b\x17[Y_\x02,\xfa\xb5\xb8\t\xcc\x0e\xd5Q\xbd\x0b?\xf5\xe4', | |||
|
550 | b'deltasize': 55, | |||
|
551 | b'node': b'F\xa6r\x1b^\xda\xf0\xea\x04\xb7\x9a\\\xb3!\x88T\xa4\xd2\xab\xa0' | |||
|
552 | }, | |||
|
553 | b'\x00\x00\x00\x00\x00\x00\x00+\x00\x00\x00+a\x000879345e39377229634b420c639454156726c6b6\n' | |||
|
554 | ] | |||
|
555 | ||||
369 | Revisions are sorted by DAG order, parents first |
|
556 | Revisions are sorted by DAG order, parents first | |
370 |
|
557 | |||
371 | $ sendhttpv2peer << EOF |
|
558 | $ sendhttpv2peer << EOF |
@@ -82,6 +82,7 b' Test basic clone' | |||||
82 | 'parents', |
|
82 | 'parents', | |
83 | 'revision' |
|
83 | 'revision' | |
84 | ]), |
|
84 | ]), | |
|
85 | 'haveparents': True, | |||
85 | 'nodes': [ |
|
86 | 'nodes': [ | |
86 | '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', |
|
87 | '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', | |
87 | '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8', |
|
88 | '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8', | |
@@ -100,6 +101,7 b' Test basic clone' | |||||
100 | 'parents', |
|
101 | 'parents', | |
101 | 'revision' |
|
102 | 'revision' | |
102 | ]), |
|
103 | ]), | |
|
104 | 'haveparents': True, | |||
103 | 'nodes': [ |
|
105 | 'nodes': [ | |
104 | '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', |
|
106 | '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |
105 | '\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc', |
|
107 | '\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc', | |
@@ -112,6 +114,7 b' Test basic clone' | |||||
112 | 'parents', |
|
114 | 'parents', | |
113 | 'revision' |
|
115 | 'revision' | |
114 | ]), |
|
116 | ]), | |
|
117 | 'haveparents': True, | |||
115 | 'nodes': [ |
|
118 | 'nodes': [ | |
116 | '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16', |
|
119 | '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16', | |
117 | '\xb1zk\xd3g=\x9a\xb8\xce\xd5\x81\xa2\t\xf6/=\xa5\xccEx', |
|
120 | '\xb1zk\xd3g=\x9a\xb8\xce\xd5\x81\xa2\t\xf6/=\xa5\xccEx', | |
@@ -211,6 +214,7 b' Cloning only a specific revision works' | |||||
211 | 'parents', |
|
214 | 'parents', | |
212 | 'revision' |
|
215 | 'revision' | |
213 | ]), |
|
216 | ]), | |
|
217 | 'haveparents': True, | |||
214 | 'nodes': [ |
|
218 | 'nodes': [ | |
215 | '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', |
|
219 | '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', | |
216 | '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8' |
|
220 | '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8' | |
@@ -226,6 +230,7 b' Cloning only a specific revision works' | |||||
226 | 'parents', |
|
230 | 'parents', | |
227 | 'revision' |
|
231 | 'revision' | |
228 | ]), |
|
232 | ]), | |
|
233 | 'haveparents': True, | |||
229 | 'nodes': [ |
|
234 | 'nodes': [ | |
230 | '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', |
|
235 | '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |
231 | '\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc' |
|
236 | '\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc' | |
@@ -237,6 +242,7 b' Cloning only a specific revision works' | |||||
237 | 'parents', |
|
242 | 'parents', | |
238 | 'revision' |
|
243 | 'revision' | |
239 | ]), |
|
244 | ]), | |
|
245 | 'haveparents': True, | |||
240 | 'nodes': [ |
|
246 | 'nodes': [ | |
241 | '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16' |
|
247 | '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16' | |
242 | ], |
|
248 | ], | |
@@ -317,6 +323,7 b' Incremental pull works' | |||||
317 | 'parents', |
|
323 | 'parents', | |
318 | 'revision' |
|
324 | 'revision' | |
319 | ]), |
|
325 | ]), | |
|
326 | 'haveparents': True, | |||
320 | 'nodes': [ |
|
327 | 'nodes': [ | |
321 | '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5', |
|
328 | '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5', | |
322 | '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f', |
|
329 | '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f', | |
@@ -333,6 +340,7 b' Incremental pull works' | |||||
333 | 'parents', |
|
340 | 'parents', | |
334 | 'revision' |
|
341 | 'revision' | |
335 | ]), |
|
342 | ]), | |
|
343 | 'haveparents': True, | |||
336 | 'nodes': [ |
|
344 | 'nodes': [ | |
337 | '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', |
|
345 | '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |
338 | '\xc2\xa2\x05\xc8\xb2\xad\xe2J\xf2`b\xe5<\xd5\xbc8\x01\xd6`\xda' |
|
346 | '\xc2\xa2\x05\xc8\xb2\xad\xe2J\xf2`b\xe5<\xd5\xbc8\x01\xd6`\xda' | |
@@ -344,6 +352,7 b' Incremental pull works' | |||||
344 | 'parents', |
|
352 | 'parents', | |
345 | 'revision' |
|
353 | 'revision' | |
346 | ]), |
|
354 | ]), | |
|
355 | 'haveparents': True, | |||
347 | 'nodes': [ |
|
356 | 'nodes': [ | |
348 | '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16', |
|
357 | '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16', | |
349 | '\xb1zk\xd3g=\x9a\xb8\xce\xd5\x81\xa2\t\xf6/=\xa5\xccEx', |
|
358 | '\xb1zk\xd3g=\x9a\xb8\xce\xd5\x81\xa2\t\xf6/=\xa5\xccEx', | |
@@ -498,6 +507,7 b' Bookmarks are transferred on clone' | |||||
498 | 'parents', |
|
507 | 'parents', | |
499 | 'revision' |
|
508 | 'revision' | |
500 | ]), |
|
509 | ]), | |
|
510 | 'haveparents': True, | |||
501 | 'nodes': [ |
|
511 | 'nodes': [ | |
502 | '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', |
|
512 | '\x99/Gy\x02\x9a=\xf8\xd0fm\x00\xbb\x92OicN&A', | |
503 | '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8', |
|
513 | '\xa9\x88\xfbCX>\x87\x1d\x1e\xd5u\x0e\xe0t\xc6\xd8@\xbb\xbf\xc8', | |
@@ -516,6 +526,7 b' Bookmarks are transferred on clone' | |||||
516 | 'parents', |
|
526 | 'parents', | |
517 | 'revision' |
|
527 | 'revision' | |
518 | ]), |
|
528 | ]), | |
|
529 | 'haveparents': True, | |||
519 | 'nodes': [ |
|
530 | 'nodes': [ | |
520 | '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', |
|
531 | '+N\xb0s\x19\xbf\xa0w\xa4\n/\x04\x916Y\xae\xf0\xdaB\xda', | |
521 | '\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc', |
|
532 | '\x9a8\x12)\x97\xb3\xac\x97\xbe*\x9a\xa2\xe5V\x83\x83A\xfd\xf2\xcc', | |
@@ -528,6 +539,7 b' Bookmarks are transferred on clone' | |||||
528 | 'parents', |
|
539 | 'parents', | |
529 | 'revision' |
|
540 | 'revision' | |
530 | ]), |
|
541 | ]), | |
|
542 | 'haveparents': True, | |||
531 | 'nodes': [ |
|
543 | 'nodes': [ | |
532 | '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16', |
|
544 | '\x81\x9e%\x8d1\xa5\xe1`f)\xf3e\xbb\x90*\x1b!\xeeB\x16', | |
533 | '\xb1zk\xd3g=\x9a\xb8\xce\xd5\x81\xa2\t\xf6/=\xa5\xccEx', |
|
545 | '\xb1zk\xd3g=\x9a\xb8\xce\xd5\x81\xa2\t\xf6/=\xa5\xccEx', |
General Comments 0
You need to be logged in to leave comments.
Login now