# HG changeset patch # User John Mulligan # Date 2008-02-21 13:24:58 # Node ID 73b1de288801fc36ef57d990d3bfe5f6047ee37a # Parent 747169c54c6875c6b5e1dd6f45ed09b3b82dbf81 Add --all option to bundle command diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -398,9 +398,10 @@ def bundle(ui, repo, fname, dest=None, * Generate a compressed changegroup file collecting changesets not found in the other repository. - If no destination repository is specified the destination is assumed - to have all the nodes specified by one or more --base parameters. - To create a bundle containing all changesets, use --base null. + If no destination repository is specified the destination is + assumed to have all the nodes specified by one or more --base + parameters. To create a bundle containing all changesets, use + --all (or --base null). The bundle file can then be transferred using conventional means and applied to another repository with the unbundle or pull command. @@ -413,7 +414,10 @@ def bundle(ui, repo, fname, dest=None, * revs = opts.get('rev') or None if revs: revs = [repo.lookup(rev) for rev in revs] - base = opts.get('base') + if opts.get('all'): + base = ['null'] + else: + base = opts.get('base') if base: if dest: raise util.Abort(_("--base is incompatible with specifiying " @@ -2812,8 +2816,10 @@ table = { _('a changeset you would like to bundle')), ('', 'base', [], _('a base changeset to specify instead of a destination')), + ('a', 'all', None, + _('bundle all changesets in the repository')), ] + remoteopts, - _('hg bundle [-f] [-r REV]... [--base REV]... FILE [DEST]')), + _('hg bundle [-f] [-a] [-r REV]... [--base REV]... FILE [DEST]')), "cat": (cat, [('o', 'output', '', _('print output to file with formatted name')), diff --git a/tests/test-bundle b/tests/test-bundle --- a/tests/test-bundle +++ b/tests/test-bundle @@ -32,6 +32,8 @@ hg verify cd .. hg init empty +echo "====== Bundle --all" +hg -R test bundle --all all.hg echo "====== Bundle test to full.hg" hg -R test bundle full.hg empty echo "====== Unbundle full.hg in test" diff --git a/tests/test-bundle.out b/tests/test-bundle.out --- a/tests/test-bundle.out +++ b/tests/test-bundle.out @@ -6,6 +6,8 @@ checking manifests crosschecking files in changesets and manifests checking files 4 files, 9 changesets, 7 total revisions +====== Bundle --all +9 changesets found ====== Bundle test to full.hg searching for changes 9 changesets found