# HG changeset patch # User Yuya Nishihara # Date 1336316284 -32400 # Node ID 46e9ed223d2c8d1fc1b1b64c7f2dab795f5d690d # Parent ebd2ead59f1ce1823728230f7cf12fc7a5990c04 commands: parse ui.strict config item as bool diff -r ebd2ead59f1c -r 46e9ed223d2c mercurial/commands.py --- 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 " diff -r ebd2ead59f1c -r 46e9ed223d2c mercurial/dispatch.py --- 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 diff -r ebd2ead59f1c -r 46e9ed223d2c tests/test-check-code-hg.t --- 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: diff -r ebd2ead59f1c -r 46e9ed223d2c tests/test-strict.t --- 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