changeset 16591:46e9ed223d2c stable

commands: parse ui.strict config item as bool
author Yuya Nishihara <yuya@tcha.org>
date Sun, 06 May 2012 23:58:04 +0900
parents ebd2ead59f1c
children 4878914b02ab e462313ef1bd
files mercurial/commands.py mercurial/dispatch.py tests/test-check-code-hg.t tests/test-strict.t
diffstat 4 files changed, 8 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun May 06 13:14:58 2012 +0200
+++ b/mercurial/commands.py	Sun May 06 23:58:04 2012 +0900
@@ -3299,7 +3299,8 @@
                        'extensions\n'))
 
     def helpextcmd(name):
-        cmd, ext, mod = extensions.disabledcmd(ui, name, ui.config('ui', 'strict'))
+        cmd, ext, mod = extensions.disabledcmd(ui, name,
+                                               ui.configbool('ui', 'strict'))
         doc = gettext(mod.__doc__).splitlines()[0]
 
         msg = help.listexts(_("'%s' is provided by the following "
--- a/mercurial/dispatch.py	Sun May 06 13:14:58 2012 +0200
+++ b/mercurial/dispatch.py	Sun May 06 23:58:04 2012 +0900
@@ -383,7 +383,7 @@
     if args:
         cmd, args = args[0], args[1:]
         aliases, entry = cmdutil.findcmd(cmd, commands.table,
-                                     ui.config("ui", "strict"))
+                                         ui.configbool("ui", "strict"))
         cmd = aliases[0]
         args = aliasargs(entry[0], args)
         defaults = ui.config("defaults", cmd)
@@ -511,7 +511,8 @@
 
     cmd = args[0]
     try:
-        aliases, entry = cmdutil.findcmd(cmd, cmdtable, lui.config("ui", "strict"))
+        aliases, entry = cmdutil.findcmd(cmd, cmdtable,
+                                         lui.configbool("ui", "strict"))
     except (error.AmbiguousCommand, error.UnknownCommand):
         commands.norepo = norepo
         return
--- a/tests/test-check-code-hg.t	Sun May 06 13:14:58 2012 +0200
+++ b/tests/test-check-code-hg.t	Sun May 06 23:58:04 2012 +0900
@@ -336,9 +336,6 @@
    >             ui.write('deltas against p2    : ' + fmt % pcfmt(nump2, numdeltas))
    warning: unwrapped ui message
   mercurial/commands.py:0:
-   >         cmd, ext, mod = extensions.disabledcmd(ui, name, ui.config('ui', 'strict'))
-   warning: line over 80 characters
-  mercurial/commands.py:0:
    >         except:
    warning: naked except clause
   mercurial/commands.py:0:
@@ -433,9 +430,6 @@
    >                                                 " (.hg not found)") % os.getcwd())
    warning: line over 80 characters
   mercurial/dispatch.py:0:
-   >         aliases, entry = cmdutil.findcmd(cmd, cmdtable, lui.config("ui", "strict"))
-   warning: line over 80 characters
-  mercurial/dispatch.py:0:
    >         except:
    warning: naked except clause
   mercurial/dispatch.py:0:
--- a/tests/test-strict.t	Sun May 06 13:14:58 2012 +0200
+++ b/tests/test-strict.t	Sun May 06 23:58:04 2012 +0900
@@ -7,6 +7,9 @@
   $ hg an a
   0: a
 
+  $ hg --config ui.strict=False an a
+  0: a
+
   $ echo "[ui]" >> $HGRCPATH
   $ echo "strict=True" >> $HGRCPATH