changeset 6171:73b1de288801

Add --all option to bundle command
author John Mulligan <phlogistonjohn@yahoo.com>
date Thu, 21 Feb 2008 08:24:58 -0500
parents 747169c54c68
children 0cd6846e5200
files mercurial/commands.py tests/test-bundle tests/test-bundle.out
diffstat 3 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Feb 23 19:37:44 2008 +0100
+++ b/mercurial/commands.py	Thu Feb 21 08:24:58 2008 -0500
@@ -398,9 +398,10 @@
     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 @@
     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 @@
            _('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')),
--- a/tests/test-bundle	Sat Feb 23 19:37:44 2008 +0100
+++ b/tests/test-bundle	Thu Feb 21 08:24:58 2008 -0500
@@ -32,6 +32,8 @@
 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"
--- a/tests/test-bundle.out	Sat Feb 23 19:37:44 2008 +0100
+++ b/tests/test-bundle.out	Thu Feb 21 08:24:58 2008 -0500
@@ -6,6 +6,8 @@
 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