[PATCH] import: describe -b/--base option in the help

Kevin Bullock kbullock+mercurial at ringworld.org
Fri Apr 22 10:40:40 CDT 2011


Thanks for sending the patch! Comments/review inline below...

On 21 Apr 2011, at 4:53 PM, David Nadlinger wrote:

> # HG changeset patch
> # User David Nadlinger <code at klickverbot.at>
> # Date 1303421957 -7200
> # Node ID f5cf342b63dea0aaf323f8a0157d8ee5d21fb6ab
> # Parent  144d64cf456e497d3110662420f5ea983c774f23
> import: describe -b/--base option in the help
> 
> Previously, the option was only documented as »base path«, leaving it unclear to what (patch files? patched files in the repo?) the passed path actually applies. This expands the help message to avoid confusion.
> 
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -2480,7 +2480,8 @@
>     copies in the patch in the same way as 'addremove'.
> 
>     To read a patch from standard input, use "-" as the patch name. If
> -    a URL is specified, the patch will be downloaded from it.
> +    a URL is specified, the patch will be downloaded from it. If a base path
> +    is given with -b/--base, it is prepended to the given patch file path(s).
>     See :hg:`help dates` for a list of formats valid for -d/--date.
> 
>     Returns 0 on success.
> @@ -4628,8 +4629,8 @@
>            _('directory strip option for patch. This has the same '
>              'meaning as the corresponding patch option'),
>            _('NUM')),
> -          ('b', 'base', '',
> -           _('base path'), _('PATH')),
> +          ('b', 'base', 'current directory',

Pretty sure the default argument shouldn't be used this way. Does this pass the test suite? That parameter is used not just to list the default in the help, but to actually give a default value to the _implementation_. Which means that by default, `import` would look for patches in './current directory/', if I'm reading the code right.

> +           _('base path patch files are searched in'), _('PATH')),
>           ('f', 'force', None,
>            _('skip check for outstanding uncommitted changes')),
>           ('', 'no-commit', None,

pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock



More information about the Mercurial-devel mailing list