mercurial/commands.py
changeset 3539 e1508621e9ef
parent 3524 ba94e80e5540
child 3549 db946221a58a
equal deleted inserted replaced
3538:9b52239dc740 3539:e1508621e9ef
  1211             errors += 1
  1211             errors += 1
  1212     if errors:
  1212     if errors:
  1213         error = _(".hg/dirstate inconsistent with current parent's manifest")
  1213         error = _(".hg/dirstate inconsistent with current parent's manifest")
  1214         raise util.Abort(error)
  1214         raise util.Abort(error)
  1215 
  1215 
  1216 def showconfig(ui, repo, *values):
  1216 def showconfig(ui, repo, *values, **opts):
  1217     """show combined config settings from all hgrc files
  1217     """show combined config settings from all hgrc files
  1218 
  1218 
  1219     With no args, print names and values of all config items.
  1219     With no args, print names and values of all config items.
  1220 
  1220 
  1221     With one arg of the form section.name, print just the value of
  1221     With one arg of the form section.name, print just the value of
  1222     that config item.
  1222     that config item.
  1223 
  1223 
  1224     With multiple args, print names and values of all config items
  1224     With multiple args, print names and values of all config items
  1225     with matching section names."""
  1225     with matching section names."""
  1226 
  1226 
       
  1227     untrusted = bool(opts.get('untrusted'))
  1227     if values:
  1228     if values:
  1228         if len([v for v in values if '.' in v]) > 1:
  1229         if len([v for v in values if '.' in v]) > 1:
  1229             raise util.Abort(_('only one config item permitted'))
  1230             raise util.Abort(_('only one config item permitted'))
  1230     for section, name, value in ui.walkconfig():
  1231     for section, name, value in ui.walkconfig(untrusted=untrusted):
  1231         sectname = section + '.' + name
  1232         sectname = section + '.' + name
  1232         if values:
  1233         if values:
  1233             for v in values:
  1234             for v in values:
  1234                 if v == section:
  1235                 if v == section:
  1235                     ui.write('%s=%s\n' % (sectname, value))
  1236                     ui.write('%s=%s\n' % (sectname, value))
  3095           ('', 'no-backup', None, _('do not save backup copies of files')),
  3096           ('', 'no-backup', None, _('do not save backup copies of files')),
  3096          ] + walkopts + dryrunopts,
  3097          ] + walkopts + dryrunopts,
  3097          _('hg revert [-r REV] [NAME]...')),
  3098          _('hg revert [-r REV] [NAME]...')),
  3098     "rollback": (rollback, [], _('hg rollback')),
  3099     "rollback": (rollback, [], _('hg rollback')),
  3099     "root": (root, [], _('hg root')),
  3100     "root": (root, [], _('hg root')),
  3100     "showconfig|debugconfig": (showconfig, [], _('showconfig [NAME]...')),
  3101     "showconfig|debugconfig":
       
  3102         (showconfig,
       
  3103          [('u', 'untrusted', None, _('show untrusted configuration options'))],
       
  3104          _('showconfig [-u] [NAME]...')),
  3101     "^serve":
  3105     "^serve":
  3102         (serve,
  3106         (serve,
  3103          [('A', 'accesslog', '', _('name of access log file to write to')),
  3107          [('A', 'accesslog', '', _('name of access log file to write to')),
  3104           ('d', 'daemon', None, _('run server in background')),
  3108           ('d', 'daemon', None, _('run server in background')),
  3105           ('', 'daemon-pipefds', '', _('used internally by daemon mode')),
  3109           ('', 'daemon-pipefds', '', _('used internally by daemon mode')),