comparison mercurial/configuration/command.py @ 52418:e98cea8fc858

config: move "component display" in the new module That part seems dubious, but at least it is now isolated. I added inline comment about how "suboptimal" it is.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 21 Oct 2024 14:13:37 +0200
parents c97e0fd26225
children 04c3fb885fb6
comparison
equal deleted inserted replaced
52417:c97e0fd26225 52418:e98cea8fc858
104 b"%s \"%s\"" % (editor, f), 104 b"%s \"%s\"" % (editor, f),
105 onerr=error.InputError, 105 onerr=error.InputError,
106 errprefix=_(b"edit failed"), 106 errprefix=_(b"edit failed"),
107 blockedtag=b'config_edit', 107 blockedtag=b'config_edit',
108 ) 108 )
109
110
111 def show_component(ui: uimod.ui, repo) -> None:
112 """show the component used to build the config
113
114 XXX this skip over various source and ignore the repository config, so it
115 XXX is probably useless old code.
116 """
117 for t, f in rcutil.rccomponents():
118 if t == b'path':
119 ui.debug(b'read config from: %s\n' % f)
120 elif t == b'resource':
121 ui.debug(b'read config from: resource:%s.%s\n' % (f[0], f[1]))
122 elif t == b'items':
123 # Don't print anything for 'items'.
124 pass
125 else:
126 raise error.ProgrammingError(b'unknown rctype: %s' % t)