Show More
@@ -68,7 +68,6 from . import ( | |||
|
68 | 68 | from .cmd_impls import graft as graft_impl |
|
69 | 69 | from .configuration import ( |
|
70 | 70 | command as config_command, |
|
71 | rcutil, | |
|
72 | 71 | ) |
|
73 | 72 | from .utils import ( |
|
74 | 73 | dateutil, |
@@ -2370,18 +2369,10 def config(ui, repo, *values, **opts): | |||
|
2370 | 2369 | edit_level = config_command.find_edit_level(ui, repo, opts) |
|
2371 | 2370 | if edit_level is not None: |
|
2372 | 2371 | return config_command.edit_config(ui, repo, edit_level) |
|
2372 | ||
|
2373 | 2373 | ui.pager(b'config') |
|
2374 | config_command.show_component(ui, repo) | |
|
2374 | 2375 | fm = ui.formatter(b'config', pycompat.byteskwargs(opts)) |
|
2375 | for t, f in rcutil.rccomponents(): | |
|
2376 | if t == b'path': | |
|
2377 | ui.debug(b'read config from: %s\n' % f) | |
|
2378 | elif t == b'resource': | |
|
2379 | ui.debug(b'read config from: resource:%s.%s\n' % (f[0], f[1])) | |
|
2380 | elif t == b'items': | |
|
2381 | # Don't print anything for 'items'. | |
|
2382 | pass | |
|
2383 | else: | |
|
2384 | raise error.ProgrammingError(b'unknown rctype: %s' % t) | |
|
2385 | 2376 | untrusted = bool(opts.get('untrusted')) |
|
2386 | 2377 | |
|
2387 | 2378 | selsections = selentries = [] |
@@ -106,3 +106,21 def edit_config(ui: uimod.ui, repo, leve | |||
|
106 | 106 | errprefix=_(b"edit failed"), |
|
107 | 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) |
General Comments 0
You need to be logged in to leave comments.
Login now