##// END OF EJS Templates
showconfig: don't accept multiple sections and one config item...
Brodie Rao -
r12697:14853ca7 default
parent child Browse files
Show More
@@ -1066,7 +1066,9 b' def showconfig(ui, repo, *values, **opts'
1066 1066 ui.debug(_('read config from: %s\n') % f)
1067 1067 untrusted = bool(opts.get('untrusted'))
1068 1068 if values:
1069 if len([v for v in values if '.' in v]) > 1:
1069 sections = [v for v in values if '.' not in v]
1070 items = [v for v in values if '.' in v]
1071 if len(items) > 1 or items and sections:
1070 1072 raise util.Abort(_('only one config item permitted'))
1071 1073 for section, name, value in ui.walkconfig(untrusted=untrusted):
1072 1074 sectname = section + '.' + name
@@ -75,6 +75,22 b' username expansion'
75 75 $ HGUSER=$olduser
76 76 $ export HGUSER
77 77
78 showconfig with multiple arguments
79
80 $ echo "[alias]" > $HGRCPATH
81 $ echo "log = log -g" >> $HGRCPATH
82 $ echo "[defaults]" >> $HGRCPATH
83 $ echo "identify = -n" >> $HGRCPATH
84 $ hg showconfig alias defaults
85 alias.log=log -g
86 defaults.identify=-n
87 $ hg showconfig alias defaults.identify
88 abort: only one config item permitted
89 [255]
90 $ hg showconfig alias.log defaults.identify
91 abort: only one config item permitted
92 [255]
93
78 94 HGPLAIN
79 95
80 96 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now