Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
47414:5fbac82a8780 | 47415:b1b3127227be |
---|---|
2198 | 2198 |
2199 @command( | 2199 @command( |
2200 b'config|showconfig|debugconfig', | 2200 b'config|showconfig|debugconfig', |
2201 [ | 2201 [ |
2202 (b'u', b'untrusted', None, _(b'show untrusted configuration options')), | 2202 (b'u', b'untrusted', None, _(b'show untrusted configuration options')), |
2203 # This is experimental because we need | |
2204 # * reasonable behavior around aliases, | |
2205 # * decide if we display [debug] [experimental] and [devel] section par | |
2206 # default | |
2207 # * some way to display "generic" config entry (the one matching | |
2208 # regexp, | |
2209 # * proper display of the different value type | |
2210 # * a better way to handle <DYNAMIC> values (and variable types), | |
2211 # * maybe some type information ? | |
2212 ( | |
2213 b'', | |
2214 b'exp-all-known', | |
2215 None, | |
2216 _(b'show all known config option (EXPERIMENTAL)'), | |
2217 ), | |
2203 (b'e', b'edit', None, _(b'edit user config')), | 2218 (b'e', b'edit', None, _(b'edit user config')), |
2204 (b'l', b'local', None, _(b'edit repository config')), | 2219 (b'l', b'local', None, _(b'edit repository config')), |
2205 (b'', b'source', None, _(b'show source of configuration value')), | 2220 (b'', b'source', None, _(b'show source of configuration value')), |
2206 ( | 2221 ( |
2207 b'', | 2222 b'', |
2334 uniquesel = len(selentries) == 1 and not selsections | 2349 uniquesel = len(selentries) == 1 and not selsections |
2335 selsections = set(selsections) | 2350 selsections = set(selsections) |
2336 selentries = set(selentries) | 2351 selentries = set(selentries) |
2337 | 2352 |
2338 matched = False | 2353 matched = False |
2354 all_known = opts[b'exp_all_known'] | |
2339 show_source = ui.debugflag or opts.get(b'source') | 2355 show_source = ui.debugflag or opts.get(b'source') |
2340 for section, name, value in ui.walkconfig(untrusted=untrusted): | 2356 entries = ui.walkconfig(untrusted=untrusted, all_known=all_known) |
2357 for section, name, value in entries: | |
2341 source = ui.configsource(section, name, untrusted) | 2358 source = ui.configsource(section, name, untrusted) |
2342 value = pycompat.bytestr(value) | 2359 value = pycompat.bytestr(value) |
2343 defaultvalue = ui.configdefault(section, name) | 2360 defaultvalue = ui.configdefault(section, name) |
2344 if fm.isplain(): | 2361 if fm.isplain(): |
2345 source = source or b'none' | 2362 source = source or b'none' |