##// END OF EJS Templates
bundle2: very first version of a bundle2 bundler...
bundle2: very first version of a bundle2 bundler This changeset is the very first of a long series. It create a new bundle2 module and add a simple class that generate and empty bundle2 container. The module is documented with the current state of the implementation. For information about the final goal you may want to consult the mercurial wiki page: http://mercurial.selenic.com/wiki/BundleFormat2 The documentation of the module will be updated with later patches adding more and more feature to the format. This patches also introduce a test case. This test case build and use its own small extension that use the new bundle2 module. Since the new format is unable to do anything right now, we could not use real mercurial code to test it. Moreover, some advanced feature of the bundle2 spec will not be used by core mercurial at all. So we need to have them tested.

File last commit:

r20801:9c5183cb default
r20801:9c5183cb default
Show More
test-bundle2.t
36 lines | 908 B | text/troff | Tads3Lexer
Create an extension to test bundle2 API
$ cat > bundle2.py << EOF
> """A small extension to test bundle2 implementation
>
> Current bundle2 implementation is far too limited to be used in any core
> code. We still need to be able to test it while it grow up.
> """
>
> from mercurial import cmdutil
> from mercurial import bundle2
> cmdtable = {}
> command = cmdutil.command(cmdtable)
>
> @command('bundle2', [], '')
> def cmdbundle2(ui, repo):
> """write a bundle2 container on standard ouput"""
> bundle = bundle2.bundle20()
> for chunk in bundle.getchunks():
> ui.write(chunk)
> EOF
$ cat >> $HGRCPATH << EOF
> [extensions]
> bundle2=$TESTTMP/bundle2.py
> EOF
The extension requires a repo (currently unused)
$ hg init main
$ cd main
Test simple generation of empty bundle
$ hg bundle2
HG20\x00\x00\x00\x00 (no-eol) (esc)