Mercurial > hg
comparison tests/test-wireproto-exchangev2.t @ 39641:aa7e312375cf
wireprotov2: let clients drive delta behavior
Previously, the "manifestdata" and "filedata" commands assumed the
receiver had all parent revisions for requested nodes. Unless the
revision had no parents, they emitted a delta instead of a fulltext.
This strategy isn't appropriate for shallow clones and for clients
that only want to access fulltext revision data for a single node
without fetching their parent revisions.
This commit adds an "haveparents" argument to the "manifestdata"
and "filedata" commands that controls delta generation behavior.
Unless "haveparents" is set, the server assumes that the client
doesn't have parent revisions unless they were previously sent
as part of the current group of revisions.
This change allows the fulltext revision data of any individual
revision to be obtained. This will facilitate shallow clones
and other data retrieval strategies that don't require all previous
revisions of an entity to be fetched.
Differential Revision: https://phab.mercurial-scm.org/D4492
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 30 Aug 2018 14:55:34 -0700 |
parents | 039bf1eddc2e |
children | d059cb669632 |
comparison
equal
deleted
inserted
replaced
39640:039bf1eddc2e | 39641:aa7e312375cf |
---|---|
80 sending command manifestdata: { | 80 sending command manifestdata: { |
81 'fields': set([ | 81 'fields': set([ |
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', |
88 '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5', | 89 '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5', |
89 '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f', | 90 '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f', |
98 sending command filedata: { | 99 sending command filedata: { |
99 'fields': set([ | 100 'fields': set([ |
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', |
106 '\xc2\xa2\x05\xc8\xb2\xad\xe2J\xf2`b\xe5<\xd5\xbc8\x01\xd6`\xda' | 108 '\xc2\xa2\x05\xc8\xb2\xad\xe2J\xf2`b\xe5<\xd5\xbc8\x01\xd6`\xda' |
107 ], | 109 ], |
110 sending command filedata: { | 112 sending command filedata: { |
111 'fields': set([ | 113 'fields': set([ |
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', |
118 '\xc5\xb1\xf9\xd3n\x1c\xc18\xbf\xb6\xef\xb3\xde\xb7]\x8c\xcad\x94\xc3' | 121 '\xc5\xb1\xf9\xd3n\x1c\xc18\xbf\xb6\xef\xb3\xde\xb7]\x8c\xcad\x94\xc3' |
119 ], | 122 ], |
209 sending command manifestdata: { | 212 sending command manifestdata: { |
210 'fields': set([ | 213 'fields': set([ |
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' |
217 ], | 221 ], |
218 'tree': '' | 222 'tree': '' |
224 sending command filedata: { | 228 sending command filedata: { |
225 'fields': set([ | 229 'fields': set([ |
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' |
232 ], | 237 ], |
233 'path': 'a' | 238 'path': 'a' |
235 sending command filedata: { | 240 sending command filedata: { |
236 'fields': set([ | 241 'fields': set([ |
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 ], |
243 'path': 'b' | 249 'path': 'b' |
244 } | 250 } |
315 sending command manifestdata: { | 321 sending command manifestdata: { |
316 'fields': set([ | 322 'fields': set([ |
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', |
323 '7\x9c\xb0\xc2\xe6d\\y\xdd\xc5\x9a\x1dG\'\xa9\xfb\x83\n\xeb&' | 330 '7\x9c\xb0\xc2\xe6d\\y\xdd\xc5\x9a\x1dG\'\xa9\xfb\x83\n\xeb&' |
324 ], | 331 ], |
331 sending command filedata: { | 338 sending command filedata: { |
332 'fields': set([ | 339 'fields': set([ |
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' |
339 ], | 347 ], |
340 'path': 'a' | 348 'path': 'a' |
342 sending command filedata: { | 350 sending command filedata: { |
343 'fields': set([ | 351 'fields': set([ |
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', |
350 '\xc5\xb1\xf9\xd3n\x1c\xc18\xbf\xb6\xef\xb3\xde\xb7]\x8c\xcad\x94\xc3' | 359 '\xc5\xb1\xf9\xd3n\x1c\xc18\xbf\xb6\xef\xb3\xde\xb7]\x8c\xcad\x94\xc3' |
351 ], | 360 ], |
496 sending command manifestdata: { | 505 sending command manifestdata: { |
497 'fields': set([ | 506 'fields': set([ |
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', |
504 '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5', | 514 '\xec\x80NH\x8c \x88\xc25\t\x9a\x10 u\x13\xbe\xcd\xc3\xdd\xa5', |
505 '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f', | 515 '\x04\\\x7f9\'\xda\x13\xe7Z\xf8\xf0\xe4\xf0HI\xe4a\xa9x\x0f', |
514 sending command filedata: { | 524 sending command filedata: { |
515 'fields': set([ | 525 'fields': set([ |
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', |
522 '\xc2\xa2\x05\xc8\xb2\xad\xe2J\xf2`b\xe5<\xd5\xbc8\x01\xd6`\xda' | 533 '\xc2\xa2\x05\xc8\xb2\xad\xe2J\xf2`b\xe5<\xd5\xbc8\x01\xd6`\xda' |
523 ], | 534 ], |
526 sending command filedata: { | 537 sending command filedata: { |
527 'fields': set([ | 538 'fields': set([ |
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', |
534 '\xc5\xb1\xf9\xd3n\x1c\xc18\xbf\xb6\xef\xb3\xde\xb7]\x8c\xcad\x94\xc3' | 546 '\xc5\xb1\xf9\xd3n\x1c\xc18\xbf\xb6\xef\xb3\xde\xb7]\x8c\xcad\x94\xc3' |
535 ], | 547 ], |