[PATCH 3 of 6] add --untrusted to showconfig

Alexis S. L. Carvalho alexis at cecm.usp.br
Wed Oct 18 04:52:17 UTC 2006


# HG changeset patch
# User Alexis S. L. Carvalho <alexis at cecm.usp.br>
# Date 1161149395 10800
# Node ID 0b41d5cd119825141b67f57efb3f20d56362e368
# Parent  b8a307f4d978897ff593ac3e8f5f5c62ba169b70
add --untrusted to showconfig

diff -r b8a307f4d978 -r 0b41d5cd1198 mercurial/commands.py
--- a/mercurial/commands.py	Wed Oct 18 02:29:51 2006 -0300
+++ b/mercurial/commands.py	Wed Oct 18 02:29:55 2006 -0300
@@ -1172,7 +1172,7 @@ def debugcheckstate(ui, repo):
         error = _(".hg/dirstate inconsistent with current parent's manifest")
         raise util.Abort(error)
 
-def showconfig(ui, repo, *values):
+def showconfig(ui, repo, *values, **opts):
     """show combined config settings from all hgrc files
 
     With no args, print names and values of all config items.
@@ -1183,10 +1183,11 @@ def showconfig(ui, repo, *values):
     With multiple args, print names and values of all config items
     with matching section names."""
 
+    untrusted = bool(opts.get('untrusted'))
     if values:
         if len([v for v in values if '.' in v]) > 1:
             raise util.Abort(_('only one config item permitted'))
-    for section, name, value in ui.walkconfig():
+    for section, name, value in ui.walkconfig(untrusted=untrusted):
         sectname = section + '.' + name
         if values:
             for v in values:
@@ -3066,7 +3067,10 @@ table = {
          _('hg revert [-r REV] [NAME]...')),
     "rollback": (rollback, [], _('hg rollback')),
     "root": (root, [], _('hg root')),
-    "showconfig|debugconfig": (showconfig, [], _('showconfig [NAME]...')),
+    "showconfig|debugconfig":
+        (showconfig,
+         [('u', 'untrusted', None, _('show untrusted configuration options'))],
+         _('showconfig [-u] [NAME]...')),
     "^serve":
         (serve,
          [('A', 'accesslog', '', _('name of access log file to write to')),



More information about the Mercurial-devel mailing list