tests/test-bundle2.t
changeset 20805 c5aaeca0cfbf
parent 20804 db9d3991d2c6
child 20809 b93bb639451a
equal deleted inserted replaced
20804:db9d3991d2c6 20805:c5aaeca0cfbf
    28   > @command('unbundle2', [], '')
    28   > @command('unbundle2', [], '')
    29   > def cmdunbundle2(ui, repo):
    29   > def cmdunbundle2(ui, repo):
    30   >     """read a bundle2 container from standard input"""
    30   >     """read a bundle2 container from standard input"""
    31   >     unbundler = bundle2.unbundle20(sys.stdin)
    31   >     unbundler = bundle2.unbundle20(sys.stdin)
    32   >     ui.write('options count: %i\n' % len(unbundler.params))
    32   >     ui.write('options count: %i\n' % len(unbundler.params))
       
    33   >     for key in sorted(unbundler.params):
       
    34   >         ui.write('- %s\n' % key)
    33   >     parts = list(unbundler)
    35   >     parts = list(unbundler)
    34   >     ui.write('parts count:   %i\n' % len(parts))
    36   >     ui.write('parts count:   %i\n' % len(parts))
    35   > EOF
    37   > EOF
    36   $ cat >> $HGRCPATH << EOF
    38   $ cat >> $HGRCPATH << EOF
    37   > [extensions]
    39   > [extensions]
    81 advisory parameters, no value
    83 advisory parameters, no value
    82 -------------------------------
    84 -------------------------------
    83 
    85 
    84 Simplest possible parameters form
    86 Simplest possible parameters form
    85 
    87 
    86 Test generation
    88 Test generation simple option
    87 
    89 
    88   $ hg bundle2 --param 'caution'
    90   $ hg bundle2 --param 'caution'
    89   HG20\x00\x07caution\x00\x00 (no-eol) (esc)
    91   HG20\x00\x07caution\x00\x00 (no-eol) (esc)
       
    92 
       
    93 Test unbundling
       
    94 
       
    95   $ hg bundle2 --param 'caution' | hg unbundle2
       
    96   options count: 1
       
    97   - caution
       
    98   parts count:   0
    90 
    99 
    91 Test generation multiple option
   100 Test generation multiple option
    92 
   101 
    93   $ hg bundle2 --param 'caution' --param 'meal'
   102   $ hg bundle2 --param 'caution' --param 'meal'
    94   HG20\x00\x0ccaution meal\x00\x00 (no-eol) (esc)
   103   HG20\x00\x0ccaution meal\x00\x00 (no-eol) (esc)
       
   104 
       
   105 Test unbundling
       
   106 
       
   107   $ hg bundle2 --param 'caution' --param 'meal' | hg unbundle2
       
   108   options count: 2
       
   109   - caution
       
   110   - meal
       
   111   parts count:   0
       
   112