Mercurial > public > mercurial-scm > hg
diff mercurial/commands.py @ 31683:00e569a2da97
rcutil: let rccomponents return different types of configs (API)
The next patches will convert environ to raw config items, and insert the
config items between systemrcpath and userrcpath. This patch teaches
rccomponents to return the type information so the caller could distinguish
between "path" and raw config "items".
author | Jun Wu <quark@fb.com> |
---|---|
date | Sun, 26 Mar 2017 21:04:29 -0700 |
parents | 07d62fa518a4 |
children | d83e51654c8a |
line wrap: on
line diff
--- a/mercurial/commands.py Sun Mar 26 20:48:00 2017 -0700 +++ b/mercurial/commands.py Sun Mar 26 21:04:29 2017 -0700 @@ -1804,8 +1804,11 @@ return ui.pager('config') fm = ui.formatter('config', opts) - for f in rcutil.rccomponents(): - ui.debug('read config from: %s\n' % f) + for t, f in rcutil.rccomponents(): + if t == 'path': + ui.debug('read config from: %s\n' % f) + else: + raise error.ProgrammingError('unknown rctype: %s' % t) untrusted = bool(opts.get('untrusted')) if values: sections = [v for v in values if '.' not in v]