[PATCH] Fix -r option in 'hg help clone'

Adrian Buehlmann adrian at cadifra.com
Thu Nov 19 03:57:19 CST 2009


On 19.11.2009 05:01, faheem at email.unc.edu wrote:
> # HG changeset patch
> # User faheem at email.unc.edu
> # Date 1258603281 18000
> # Node ID 8b231db33a4da2db9bb400b4c72059b1f73c2f5a
> # Parent  d266aa7606ce82fa926a1d3389453d7cb7b8f200
> Fix -r option in 'hg help clone'.
> 
> diff -r d266aa7606ce -r 8b231db33a4d mercurial/commands.py
> --- a/mercurial/commands.py	Wed Nov 18 00:19:42 2009 +0100
> +++ b/mercurial/commands.py	Wed Nov 18 23:01:21 2009 -0500
> @@ -3386,7 +3386,7 @@
>            ('u', 'updaterev', '',
>             _('revision, tag or branch to check out')),
>            ('r', 'rev', [],
> -           _('a changeset you would like to have after cloning')),
> +           _('a specific revision up to which you would like to clone')),
>            ('', 'pull', None, _('use pull protocol to copy metadata')),
>            ('', 'uncompressed', None,
>             _('use uncompressed transfer (fast over LAN)')),

I agree the text for the --rev option could be better. But I'm not sure if
this patch is really an improvement.

We do have in the main part of clone's help text:

'''
    A set of changesets (tags, or branch names) to pull may be specified by
    listing each changeset (tag, or branch name) with -r/--rev. If -r/--rev is
    used, the cloned repository will contain only a subset of the changesets
    of the source repository. Only the set of changesets defined by all
    -r/--rev options (including all their ancestors) will be pulled into the
    destination repository. No subsequent changesets (including subsequent
    tags) will be present in the destination.

    Using -r/--rev (or 'clone src#rev dest') implies --pull, even for local
    source repositories.
'''

Both the old and the proposed '--rev' text (as per faheem's patch) feel somewhat
wrong. But it's hard to find a text for the --rev option that fits into such
a small space and is still correct.

Maybe:

@@ -3386,7 +3386,7 @@
           ('u', 'updaterev', '',
            _('revision, tag or branch to check out')),
           ('r', 'rev', [],
-           _('a changeset you would like to have after cloning')),
+           _('exclusive revision, tag or branch to pull')),
           ('', 'pull', None, _('use pull protocol to copy metadata')),
           ('', 'uncompressed', None,
            _('use uncompressed transfer (fast over LAN)')),

or without 'exclusive':

@@ -3386,7 +3386,7 @@
           ('u', 'updaterev', '',
            _('revision, tag or branch to check out')),
           ('r', 'rev', [],
-           _('a changeset you would like to have after cloning')),
+           _('revision, tag or branch to pull')),
           ('', 'pull', None, _('use pull protocol to copy metadata')),
           ('', 'uncompressed', None,
            _('use uncompressed transfer (fast over LAN)')),

?

Anyway, it's definitely impossible to understand what clone really does
with --rev without reading the main part of clone's help text (no matter what
we try to stick into the --rev option text).


More information about the Mercurial-devel mailing list