tests/test-bundle2.t
changeset 21133 bef4a2adc532
parent 21131 b7435117d951
child 21135 98fbf3adfd83
equal deleted inserted replaced
21132:350dc24a553d 21133:bef4a2adc532
    35   > 
    35   > 
    36   > @bundle2.parthandler('test:ping')
    36   > @bundle2.parthandler('test:ping')
    37   > def pinghandler(op, part):
    37   > def pinghandler(op, part):
    38   >     op.ui.write('received ping request (id %i)\n' % part.id)
    38   >     op.ui.write('received ping request (id %i)\n' % part.id)
    39   >     if op.reply is not None:
    39   >     if op.reply is not None:
       
    40   >         op.ui.write_err('replying to ping request (id %i)\n' % part.id)
    40   >         rpart = bundle2.bundlepart('test:pong',
    41   >         rpart = bundle2.bundlepart('test:pong',
    41   >                                    [('in-reply-to', str(part.id))])
    42   >                                    [('in-reply-to', str(part.id))])
    42   >         op.reply.addpart(rpart)
    43   >         op.reply.addpart(rpart)
    43   > 
    44   > 
    44   > @command('bundle2',
    45   > @command('bundle2',
   507   $ cat ../reply.hg2
   508   $ cat ../reply.hg2
   508   HG20\x00\x00\x00\x1b\x06output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc)
   509   HG20\x00\x00\x00\x1b\x06output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc)
   509       Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
   510       Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
   510       Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
   511       Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
   511       Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
   512       Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
   512   \x00\x00\x00\x00\x00\x1e	test:pong\x00\x00\x00\x01\x01\x00\x0b\x01in-reply-to5\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x02\x00\x01\x0b\x01in-reply-to5\x00\x00\x00\x1dreceived ping request (id 5) (esc)
   513   \x00\x00\x00\x00\x00\x1e	test:pong\x00\x00\x00\x01\x01\x00\x0b\x01in-reply-to5\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x02\x00\x01\x0b\x01in-reply-to5\x00\x00\x00=received ping request (id 5) (esc)
       
   514   replying to ping request (id 5)
   513   \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
   515   \x00\x00\x00\x00\x00\x00 (no-eol) (esc)
   514 
   516 
   515 The reply is valid
   517 The reply is valid
   516 
   518 
   517   $ hg statbundle2 < ../reply.hg2
   519   $ hg statbundle2 < ../reply.hg2
   525       advisory: 0
   527       advisory: 0
   526       payload: 0 bytes
   528       payload: 0 bytes
   527     :output:
   529     :output:
   528       mandatory: 0
   530       mandatory: 0
   529       advisory: 1
   531       advisory: 1
   530       payload: 29 bytes
   532       payload: 61 bytes
   531   parts count:   3
   533   parts count:   3
   532 
   534 
   533 Unbundle the reply to get the output:
   535 Unbundle the reply to get the output:
   534 
   536 
   535   $ hg unbundle2 < ../reply.hg2
   537   $ hg unbundle2 < ../reply.hg2
   536   remote: The choir starts singing:
   538   remote: The choir starts singing:
   537   remote:     Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
   539   remote:     Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
   538   remote:     Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
   540   remote:     Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
   539   remote:     Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
   541   remote:     Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
   540   remote: received ping request (id 5)
   542   remote: received ping request (id 5)
       
   543   remote: replying to ping request (id 5)
   541   0 unread bytes
   544   0 unread bytes
   542 
   545 
   543 Support for changegroup
   546 Support for changegroup
   544 ===================================
   547 ===================================
   545 
   548