##// END OF EJS Templates
bundle2: lazily iterate over bundle parts in the test...
Pierre-Yves David -
r21017:8de8187e default
parent child Browse files
Show More
@@ -146,13 +146,14 b' Create an extension to test bundle2 API'
146 > value = params[key]
146 > value = params[key]
147 > if value is not None:
147 > if value is not None:
148 > ui.write(' %s\n' % value)
148 > ui.write(' %s\n' % value)
149 > parts = list(unbundler)
149 > count = 0
150 > ui.write('parts count: %i\n' % len(parts))
150 > for p in unbundler:
151 > for p in parts:
151 > count += 1
152 > ui.write(' :%s:\n' % p.type)
152 > ui.write(' :%s:\n' % p.type)
153 > ui.write(' mandatory: %i\n' % len(p.mandatoryparams))
153 > ui.write(' mandatory: %i\n' % len(p.mandatoryparams))
154 > ui.write(' advisory: %i\n' % len(p.advisoryparams))
154 > ui.write(' advisory: %i\n' % len(p.advisoryparams))
155 > ui.write(' payload: %i bytes\n' % len(p.data))
155 > ui.write(' payload: %i bytes\n' % len(p.data))
156 > ui.write('parts count: %i\n' % count)
156 > EOF
157 > EOF
157 $ cat >> $HGRCPATH << EOF
158 $ cat >> $HGRCPATH << EOF
158 > [extensions]
159 > [extensions]
@@ -346,7 +347,6 b' Test part'
346
347
347 $ hg statbundle2 < ../parts.hg2
348 $ hg statbundle2 < ../parts.hg2
348 options count: 0
349 options count: 0
349 parts count: 5
350 :test:empty:
350 :test:empty:
351 mandatory: 0
351 mandatory: 0
352 advisory: 0
352 advisory: 0
@@ -367,6 +367,7 b' Test part'
367 mandatory: 0
367 mandatory: 0
368 advisory: 0
368 advisory: 0
369 payload: 0 bytes
369 payload: 0 bytes
370 parts count: 5
370
371
371 $ hg statbundle2 --debug < ../parts.hg2
372 $ hg statbundle2 --debug < ../parts.hg2
372 start processing of HG20 stream
373 start processing of HG20 stream
@@ -378,51 +379,51 b' Test part'
378 part id: "0"
379 part id: "0"
379 part parameters: 0
380 part parameters: 0
380 payload chunk size: 0
381 payload chunk size: 0
382 :test:empty:
383 mandatory: 0
384 advisory: 0
385 payload: 0 bytes
381 part header size: 17
386 part header size: 17
382 part type: "test:empty"
387 part type: "test:empty"
383 part id: "1"
388 part id: "1"
384 part parameters: 0
389 part parameters: 0
385 payload chunk size: 0
390 payload chunk size: 0
391 :test:empty:
392 mandatory: 0
393 advisory: 0
394 payload: 0 bytes
386 part header size: 16
395 part header size: 16
387 part type: "test:song"
396 part type: "test:song"
388 part id: "2"
397 part id: "2"
389 part parameters: 0
398 part parameters: 0
390 payload chunk size: 178
399 payload chunk size: 178
391 payload chunk size: 0
400 payload chunk size: 0
401 :test:song:
402 mandatory: 0
403 advisory: 0
404 payload: 178 bytes
392 part header size: 43
405 part header size: 43
393 part type: "test:math"
406 part type: "test:math"
394 part id: "3"
407 part id: "3"
395 part parameters: 3
408 part parameters: 3
396 payload chunk size: 2
409 payload chunk size: 2
397 payload chunk size: 0
410 payload chunk size: 0
411 :test:math:
412 mandatory: 2
413 advisory: 1
414 payload: 2 bytes
398 part header size: 16
415 part header size: 16
399 part type: "test:ping"
416 part type: "test:ping"
400 part id: "4"
417 part id: "4"
401 part parameters: 0
418 part parameters: 0
402 payload chunk size: 0
419 payload chunk size: 0
403 part header size: 0
404 end of bundle2 stream
405 parts count: 5
406 :test:empty:
407 mandatory: 0
408 advisory: 0
409 payload: 0 bytes
410 :test:empty:
411 mandatory: 0
412 advisory: 0
413 payload: 0 bytes
414 :test:song:
415 mandatory: 0
416 advisory: 0
417 payload: 178 bytes
418 :test:math:
419 mandatory: 2
420 advisory: 1
421 payload: 2 bytes
422 :test:ping:
420 :test:ping:
423 mandatory: 0
421 mandatory: 0
424 advisory: 0
422 advisory: 0
425 payload: 0 bytes
423 payload: 0 bytes
424 part header size: 0
425 end of bundle2 stream
426 parts count: 5
426
427
427 Test actual unbundling of test part
428 Test actual unbundling of test part
428 =======================================
429 =======================================
@@ -509,11 +510,11 b' The reply is valid'
509
510
510 $ hg statbundle2 < ../reply.hg2
511 $ hg statbundle2 < ../reply.hg2
511 options count: 0
512 options count: 0
512 parts count: 1
513 :test:pong:
513 :test:pong:
514 mandatory: 1
514 mandatory: 1
515 advisory: 0
515 advisory: 0
516 payload: 0 bytes
516 payload: 0 bytes
517 parts count: 1
517
518
518 Support for changegroup
519 Support for changegroup
519 ===================================
520 ===================================
General Comments 0
You need to be logged in to leave comments. Login now