# HG changeset patch # User Yuya Nishihara # Date 2012-05-06 14:58:04 # Node ID 46e9ed223d2c8d1fc1b1b64c7f2dab795f5d690d # Parent ebd2ead59f1ce1823728230f7cf12fc7a5990c04 commands: parse ui.strict config item as bool diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3299,7 +3299,8 @@ def help_(ui, name=None, unknowncmd=Fals '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 " diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -383,7 +383,7 @@ def _parse(ui, args): 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 @@ def _checkshellalias(lui, ui, args): 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 diff --git a/tests/test-check-code-hg.t b/tests/test-check-code-hg.t --- a/tests/test-check-code-hg.t +++ b/tests/test-check-code-hg.t @@ -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: diff --git a/tests/test-strict.t b/tests/test-strict.t --- a/tests/test-strict.t +++ b/tests/test-strict.t @@ -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