diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -592,14 +592,12 @@ def _dispatch(req): (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3])) atexit.register(print_time) - if options['verbose'] or options['debug'] or options['quiet']: - for ui_ in (ui, lui): - ui_.setconfig('ui', 'verbose', str(bool(options['verbose']))) - ui_.setconfig('ui', 'debug', str(bool(options['debug']))) - ui_.setconfig('ui', 'quiet', str(bool(options['quiet']))) - if options['traceback']: - for ui_ in (ui, lui): - ui_.setconfig('ui', 'traceback', 'on') + for opt in ('verbose', 'debug', 'quiet', 'traceback'): + val = bool(options[opt]) + if val: + for ui_ in (ui, lui): + ui_.setconfig('ui', opt, str(val)) + if options['noninteractive']: for ui_ in (ui, lui): ui_.setconfig('ui', 'interactive', 'off') diff --git a/tests/test-hgrc.t b/tests/test-hgrc.t --- a/tests/test-hgrc.t +++ b/tests/test-hgrc.t @@ -54,6 +54,12 @@ issue1829: wrong indentation warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ unset FAKEPATH +make sure unspecified global ui options don't override old values + + $ hg showconfig --config ui.verbose=True --quiet + ui.verbose=True + ui.quiet=True + username expansion $ olduser=$HGUSER @@ -134,9 +140,7 @@ plain hgrc $ hg showconfig --config ui.traceback=True --debug read config from: $TESTTMP/hgrc none: ui.traceback=True - none: ui.verbose=False none: ui.debug=True - none: ui.quiet=False plain mode with exceptions @@ -152,24 +156,18 @@ plain mode with exceptions read config from: $TESTTMP/hgrc $TESTTMP/hgrc:15: extensions.plain=./plain.py none: ui.traceback=True - none: ui.verbose=False none: ui.debug=True - none: ui.quiet=False $ unset HGPLAIN $ hg showconfig --config ui.traceback=True --debug plain: True read config from: $TESTTMP/hgrc $TESTTMP/hgrc:15: extensions.plain=./plain.py none: ui.traceback=True - none: ui.verbose=False none: ui.debug=True - none: ui.quiet=False $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT $ hg showconfig --config ui.traceback=True --debug plain: True read config from: $TESTTMP/hgrc $TESTTMP/hgrc:15: extensions.plain=./plain.py none: ui.traceback=True - none: ui.verbose=False none: ui.debug=True - none: ui.quiet=False