Mercurial > hg
diff mercurial/commands.py @ 47415:b1b3127227be
config: add an experimental option to list all known config
That option is not ready for prime-time, hence the `exp-` prefix. However, this
is a good base to start going toward completion. This is also quite useful for
developer on its own for now.
Differential Revision: https://phab.mercurial-scm.org/D10356
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 09 Apr 2021 17:04:39 +0200 |
parents | 294a0aa51b8b |
children | 5c49e0aa7fad |
line wrap: on
line diff
--- a/mercurial/commands.py Sat Jun 12 00:51:34 2021 -0400 +++ b/mercurial/commands.py Fri Apr 09 17:04:39 2021 +0200 @@ -2200,6 +2200,21 @@ b'config|showconfig|debugconfig', [ (b'u', b'untrusted', None, _(b'show untrusted configuration options')), + # This is experimental because we need + # * reasonable behavior around aliases, + # * decide if we display [debug] [experimental] and [devel] section par + # default + # * some way to display "generic" config entry (the one matching + # regexp, + # * proper display of the different value type + # * a better way to handle <DYNAMIC> values (and variable types), + # * maybe some type information ? + ( + b'', + b'exp-all-known', + None, + _(b'show all known config option (EXPERIMENTAL)'), + ), (b'e', b'edit', None, _(b'edit user config')), (b'l', b'local', None, _(b'edit repository config')), (b'', b'source', None, _(b'show source of configuration value')), @@ -2336,8 +2351,10 @@ selentries = set(selentries) matched = False + all_known = opts[b'exp_all_known'] show_source = ui.debugflag or opts.get(b'source') - for section, name, value in ui.walkconfig(untrusted=untrusted): + entries = ui.walkconfig(untrusted=untrusted, all_known=all_known) + for section, name, value in entries: source = ui.configsource(section, name, untrusted) value = pycompat.bytestr(value) defaultvalue = ui.configdefault(section, name)