[PATCH 3 of 9] commands: update help for "bundle"

Gregory Szorc gregory.szorc at gmail.com
Sat Apr 1 18:31:54 EDT 2017


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1491079423 25200
#      Sat Apr 01 13:43:43 2017 -0700
# Node ID 21f9e3b5f24ec3e9ec7fa00510fce197b443429a
# Parent  01ebce23203fb3a7bb0367040a62075df6c275f6
commands: update help for "bundle"

We now have a dedicated help topic to describe bundle specification
strings. Let's update `hg bundle`'s documentation to reflect its
existence.

While I was hear, I also tweaked some wording which I felt was out
of date and needed tweaking. Specifically, `hg bundle` no longer
just deals with "changegroup" data: it can also generate files
that have non-changegroup data.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1281,12 +1281,11 @@ def branches(ui, repo, active=False, clo
     ('a', 'all', None, _('bundle all changesets in the repository')),
     ('t', 'type', 'bzip2', _('bundle compression type to use'), _('TYPE')),
     ] + remoteopts,
-    _('[-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]'))
+    _('[-f] [-t BUNDLESPEC] [-a] [-r REV]... [--base REV]... FILE [DEST]'))
 def bundle(ui, repo, fname, dest=None, **opts):
-    """create a changegroup file
-
-    Generate a changegroup file collecting changesets to be added
-    to a repository.
+    """create a bundle file
+
+    Generate a bundle file containing data to be added to a repository.
 
     To create a bundle containing all changesets, use -a/--all
     (or --base null). Otherwise, hg assumes the destination will have
@@ -1294,11 +1293,10 @@ def bundle(ui, repo, fname, dest=None, *
     will assume the repository has all the nodes in destination, or
     default-push/default if no destination is specified.
 
-    You can change bundle format with the -t/--type option. You can
-    specify a compression, a bundle version or both using a dash
-    (comp-version). The available compression methods are: none, bzip2,
-    and gzip (by default, bundles are compressed using bzip2). The
-    available formats are: v1, v2 (default to most suitable).
+    You can change bundle format with the -t/--type option. See
+    :hg:`help bundlespec` for documentation on this format. By default,
+    the most appropriate format is used and compression defaults to
+    bzip2.
 
     The bundle file can then be transferred using conventional means
     and applied to another repository with the unbundle or pull
@@ -1323,7 +1321,7 @@ def bundle(ui, repo, fname, dest=None, *
                 repo, bundletype, strict=False)
     except error.UnsupportedBundleSpecification as e:
         raise error.Abort(str(e),
-                          hint=_("see 'hg help bundle' for supported "
+                          hint=_("see 'hg help bundlespec' for supported "
                                  "values for --type"))
 
     # Packed bundles are a pseudo bundle format for now.
diff --git a/tests/test-bundle-type.t b/tests/test-bundle-type.t
--- a/tests/test-bundle-type.t
+++ b/tests/test-bundle-type.t
@@ -40,12 +40,12 @@ Unknown compression type is rejected
   $ hg -q pull ../b1
   $ hg bundle -a -t unknown out.hg
   abort: unknown is not a recognized bundle specification
-  (see 'hg help bundle' for supported values for --type)
+  (see 'hg help bundlespec' for supported values for --type)
   [255]
 
   $ hg bundle -a -t unknown-v2 out.hg
   abort: unknown compression is not supported
-  (see 'hg help bundle' for supported values for --type)
+  (see 'hg help bundlespec' for supported values for --type)
   [255]
 
   $ cd ..
@@ -193,7 +193,7 @@ zstd-v1 always fails
 
   $ hg -R tzstd bundle -a -t zstd-v1 zstd-v1
   abort: compression engine zstd is not supported on v1 bundles
-  (see 'hg help bundle' for supported values for --type)
+  (see 'hg help bundlespec' for supported values for --type)
   [255]
 
 #else
@@ -222,6 +222,6 @@ test invalid bundle type
   $ cd t1
   $ hg bundle -a -t garbage ../bgarbage
   abort: garbage is not a recognized bundle specification
-  (see 'hg help bundle' for supported values for --type)
+  (see 'hg help bundlespec' for supported values for --type)
   [255]
   $ cd ..
diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t
--- a/tests/test-globalopts.t
+++ b/tests/test-globalopts.t
@@ -296,7 +296,7 @@ Testing -h/--help:
    bookmarks     create a new bookmark or list existing bookmarks
    branch        set or show the current branch name
    branches      list repository named branches
-   bundle        create a changegroup file
+   bundle        create a bundle file
    cat           output the current or given revision of files
    clone         make a copy of an existing repository
    commit        commit the specified files or all outstanding changes
@@ -380,7 +380,7 @@ Testing -h/--help:
    bookmarks     create a new bookmark or list existing bookmarks
    branch        set or show the current branch name
    branches      list repository named branches
-   bundle        create a changegroup file
+   bundle        create a bundle file
    cat           output the current or given revision of files
    clone         make a copy of an existing repository
    commit        commit the specified files or all outstanding changes
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -58,7 +58,7 @@ Short help:
    bookmarks     create a new bookmark or list existing bookmarks
    branch        set or show the current branch name
    branches      list repository named branches
-   bundle        create a changegroup file
+   bundle        create a bundle file
    cat           output the current or given revision of files
    clone         make a copy of an existing repository
    commit        commit the specified files or all outstanding changes
@@ -136,7 +136,7 @@ Short help:
    bookmarks     create a new bookmark or list existing bookmarks
    branch        set or show the current branch name
    branches      list repository named branches
-   bundle        create a changegroup file
+   bundle        create a bundle file
    cat           output the current or given revision of files
    clone         make a copy of an existing repository
    commit        commit the specified files or all outstanding changes
@@ -781,7 +781,7 @@ Test that default list of commands omits
    bookmarks     create a new bookmark or list existing bookmarks
    branch        set or show the current branch name
    branches      list repository named branches
-   bundle        create a changegroup file
+   bundle        create a bundle file
    cat           output the current or given revision of files
    clone         make a copy of an existing repository
    commit        commit the specified files or all outstanding changes
@@ -2246,7 +2246,7 @@ Dish up an empty repo; serve it cold.
   bundle
   </a>
   </td><td>
-  create a changegroup file
+  create a bundle file
   </td></tr>
   <tr><td>
   <a href="/help/cat">
diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t
--- a/tests/test-hgweb-json.t
+++ b/tests/test-hgweb-json.t
@@ -1443,7 +1443,7 @@ help/ shows help topics
         "topic": "branches"
       },
       {
-        "summary": "create a changegroup file",
+        "summary": "create a bundle file",
         "topic": "bundle"
       },
       {


More information about the Mercurial-devel mailing list