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

David Nadlinger code at klickverbot.at
Fri Apr 22 10:48:50 CDT 2011


On 4/22/11 5:40 PM, Kevin Bullock wrote:
> 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.

Oh, how embarrassing – I guess that's what you get from not running the 
test suite after what you believe to be a string change. After a second 
look, it's pretty much obvious that the argument is used in code because 
it isn't i18n'd… I attached the corrected patch below.

David


# HG changeset patch
# User David Nadlinger <code at klickverbot.at>
# Date 1303487273 -7200
# Node ID 2d6a2f2ba91bb56f8fcabf9d1c82619dc3be6e5b
# Parent  e0f07847f8de2a349ce6f17b36cb6beb64da704d
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.
@@ -4629,7 +4630,7 @@
               'meaning as the corresponding patch option'),
             _('NUM')),
            ('b', 'base', '',
-           _('base path'), _('PATH')),
+           _('base path patch files are searched in'), _('PATH')),
            ('f', 'force', None,
             _('skip check for outstanding uncommitted changes')),
            ('', 'no-commit', None,


More information about the Mercurial-devel mailing list