tests/test-bundle2.t
changeset 20801 9c5183cb9bca
child 20802 520df53ad26a
equal deleted inserted replaced
20800:8253e55930a3 20801:9c5183cb9bca
       
     1 
       
     2 Create an extension to test bundle2 API
       
     3 
       
     4   $ cat > bundle2.py << EOF
       
     5   > """A small extension to test bundle2 implementation
       
     6   > 
       
     7   > Current bundle2 implementation is far too limited to be used in any core
       
     8   > code. We still need to be able to test it while it grow up.
       
     9   > """
       
    10   > 
       
    11   > from mercurial import cmdutil
       
    12   > from mercurial import bundle2
       
    13   > cmdtable = {}
       
    14   > command = cmdutil.command(cmdtable)
       
    15   > 
       
    16   > @command('bundle2', [], '')
       
    17   > def cmdbundle2(ui, repo):
       
    18   >     """write a bundle2 container on standard ouput"""
       
    19   >     bundle = bundle2.bundle20()
       
    20   >     for chunk in bundle.getchunks():
       
    21   >         ui.write(chunk)
       
    22   > EOF
       
    23   $ cat >> $HGRCPATH << EOF
       
    24   > [extensions]
       
    25   > bundle2=$TESTTMP/bundle2.py
       
    26   > EOF
       
    27 
       
    28 The extension requires a repo (currently unused)
       
    29 
       
    30   $ hg init main
       
    31   $ cd main
       
    32 
       
    33 Test simple generation of empty bundle
       
    34 
       
    35   $ hg bundle2
       
    36   HG20\x00\x00\x00\x00 (no-eol) (esc)