Mercurial > public > mercurial-scm > hg
diff mercurial/dispatch.py @ 20788:f144928dd058
config: give a useful hint of source for the most common command line settings
'hg showconfig --debug' will instead of:
none: ui.verbose=False
give the better hint:
--verbose: ui.verbose=False
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Wed, 19 Mar 2014 02:45:04 +0100 |
parents | 69a0d22b9677 |
children | 131f7fe06e9e |
line wrap: on
line diff
--- a/mercurial/dispatch.py Wed Mar 19 01:59:15 2014 +0100 +++ b/mercurial/dispatch.py Wed Mar 19 02:45:04 2014 +0100 @@ -40,7 +40,7 @@ if not req.ui: req.ui = uimod.ui() if '--traceback' in req.args: - req.ui.setconfig('ui', 'traceback', 'on') + req.ui.setconfig('ui', 'traceback', 'on', '--traceback') # set ui streams from the request if req.fin: @@ -104,7 +104,7 @@ # copy configs that were passed on the cmdline (--config) to # the repo ui for cfg in cfgs: - req.repo.ui.setconfig(*cfg) + req.repo.ui.setconfig(*cfg, source='--config') # if we are in HGPLAIN mode, then disable custom debugging debugger = ui.config("ui", "debugger") @@ -518,7 +518,7 @@ section, name = name.split('.', 1) if not section or not name: raise IndexError - ui.setconfig(section, name, value) + ui.setconfig(section, name, value, '--config') configs.append((section, name, value)) except (IndexError, ValueError): raise util.Abort(_('malformed --config option: %r ' @@ -735,19 +735,19 @@ for opt in ('verbose', 'debug', 'quiet'): val = str(bool(options[opt])) for ui_ in uis: - ui_.setconfig('ui', opt, val) + ui_.setconfig('ui', opt, val, '--' + opt) if options['traceback']: for ui_ in uis: - ui_.setconfig('ui', 'traceback', 'on') + ui_.setconfig('ui', 'traceback', 'on', '--traceback') if options['noninteractive']: for ui_ in uis: - ui_.setconfig('ui', 'interactive', 'off') + ui_.setconfig('ui', 'interactive', 'off', '-y') if cmdoptions.get('insecure', False): for ui_ in uis: - ui_.setconfig('web', 'cacerts', '') + ui_.setconfig('web', 'cacerts', '', '--insecure') if options['version']: return commands.version_(ui) @@ -773,7 +773,7 @@ repo = hg.repository(ui, path=path) if not repo.local(): raise util.Abort(_("repository '%s' is not local") % path) - repo.ui.setconfig("bundle", "mainreporoot", repo.root) + repo.ui.setconfig("bundle", "mainreporoot", repo.root, 'repo') except error.RequirementError: raise except error.RepoError: