##// END OF EJS Templates
debugconfig: allow to print by section and exact item name
Vadim Gelfer -
r2410:1e80d47b default
parent child Browse files
Show More
@@ -1271,10 +1271,30 b' def debugcheckstate(ui, repo):'
1271 1271 error = _(".hg/dirstate inconsistent with current parent's manifest")
1272 1272 raise util.Abort(error)
1273 1273
1274 def debugconfig(ui, repo):
1275 """show combined config settings from all hgrc files"""
1274 def debugconfig(ui, repo, *values):
1275 """show combined config settings from all hgrc files
1276
1277 With no args, print names and values of all config items.
1278
1279 With one arg of the form section.name, print just the value of
1280 that config item.
1281
1282 With multiple args, print names and values of all config items
1283 with matching section names."""
1284
1285 if values:
1286 if len([v for v in values if '.' in v]) > 1:
1287 raise util.Abort(_('only one config item permitted'))
1276 1288 for section, name, value in ui.walkconfig():
1277 ui.write('%s.%s=%s\n' % (section, name, value))
1289 sectname = section + '.' + name
1290 if values:
1291 for v in values:
1292 if v == section:
1293 ui.write('%s=%s\n' % (sectname, value))
1294 elif v == sectname:
1295 ui.write(value, '\n')
1296 else:
1297 ui.write('%s=%s\n' % (sectname, value))
1278 1298
1279 1299 def debugsetparents(ui, repo, rev1, rev2=None):
1280 1300 """manually set the parents of the current working directory
@@ -2870,7 +2890,7 b' table = {'
2870 2890 [('r', 'rev', '', _('revision to rebuild to'))],
2871 2891 _('debugrebuildstate [-r REV] [REV]')),
2872 2892 "debugcheckstate": (debugcheckstate, [], _('debugcheckstate')),
2873 "debugconfig": (debugconfig, [], _('debugconfig')),
2893 "debugconfig": (debugconfig, [], _('debugconfig [NAME]...')),
2874 2894 "debugsetparents": (debugsetparents, [], _('debugsetparents REV1 [REV2]')),
2875 2895 "debugstate": (debugstate, [], _('debugstate')),
2876 2896 "debugdata": (debugdata, [], _('debugdata FILE REV')),
General Comments 0
You need to be logged in to leave comments. Login now