##// END OF EJS Templates
dispatch: make sure global options on the command line take precedence...
Idan Kamara -
r14992:188936b3 stable
parent child Browse files
Show More
@@ -608,11 +608,15 b' def _dispatch(req):'
608 for cfg in cfgs:
608 for cfg in cfgs:
609 req.repo.ui.setconfig(*cfg)
609 req.repo.ui.setconfig(*cfg)
610
610
611 for opt in ('verbose', 'debug', 'quiet', 'traceback'):
611 if options['verbose'] or options['debug'] or options['quiet']:
612 val = bool(options[opt])
612 for opt in ('verbose', 'debug', 'quiet'):
613 if val:
613 val = str(bool(options[opt]))
614 for ui_ in uis:
614 for ui_ in uis:
615 ui_.setconfig('ui', opt, str(val))
615 ui_.setconfig('ui', opt, val)
616
617 if options['traceback']:
618 for ui_ in uis:
619 ui_.setconfig('ui', 'traceback', 'on')
616
620
617 if options['noninteractive']:
621 if options['noninteractive']:
618 for ui_ in uis:
622 for ui_ in uis:
@@ -54,12 +54,20 b' issue1829: wrong indentation'
54 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
54 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
55 $ unset FAKEPATH
55 $ unset FAKEPATH
56
56
57 make sure unspecified global ui options don't override old values
57 make sure global options given on the cmdline take precedence
58
58
59 $ hg showconfig --config ui.verbose=True --quiet
59 $ hg showconfig --config ui.verbose=True --quiet
60 ui.verbose=True
60 ui.verbose=False
61 ui.debug=False
61 ui.quiet=True
62 ui.quiet=True
62
63
64 $ touch foobar/untracked
65 $ cat >> foobar/.hg/hgrc <<EOF
66 > [ui]
67 > verbose=True
68 > EOF
69 $ hg -R foobar st -q
70
63 username expansion
71 username expansion
64
72
65 $ olduser=$HGUSER
73 $ olduser=$HGUSER
@@ -140,7 +148,9 b' plain hgrc'
140 $ hg showconfig --config ui.traceback=True --debug
148 $ hg showconfig --config ui.traceback=True --debug
141 read config from: $TESTTMP/hgrc
149 read config from: $TESTTMP/hgrc
142 none: ui.traceback=True
150 none: ui.traceback=True
151 none: ui.verbose=False
143 none: ui.debug=True
152 none: ui.debug=True
153 none: ui.quiet=False
144
154
145 plain mode with exceptions
155 plain mode with exceptions
146
156
@@ -156,18 +166,24 b' plain mode with exceptions'
156 read config from: $TESTTMP/hgrc
166 read config from: $TESTTMP/hgrc
157 $TESTTMP/hgrc:15: extensions.plain=./plain.py
167 $TESTTMP/hgrc:15: extensions.plain=./plain.py
158 none: ui.traceback=True
168 none: ui.traceback=True
169 none: ui.verbose=False
159 none: ui.debug=True
170 none: ui.debug=True
171 none: ui.quiet=False
160 $ unset HGPLAIN
172 $ unset HGPLAIN
161 $ hg showconfig --config ui.traceback=True --debug
173 $ hg showconfig --config ui.traceback=True --debug
162 plain: True
174 plain: True
163 read config from: $TESTTMP/hgrc
175 read config from: $TESTTMP/hgrc
164 $TESTTMP/hgrc:15: extensions.plain=./plain.py
176 $TESTTMP/hgrc:15: extensions.plain=./plain.py
165 none: ui.traceback=True
177 none: ui.traceback=True
178 none: ui.verbose=False
166 none: ui.debug=True
179 none: ui.debug=True
180 none: ui.quiet=False
167 $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT
181 $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT
168 $ hg showconfig --config ui.traceback=True --debug
182 $ hg showconfig --config ui.traceback=True --debug
169 plain: True
183 plain: True
170 read config from: $TESTTMP/hgrc
184 read config from: $TESTTMP/hgrc
171 $TESTTMP/hgrc:15: extensions.plain=./plain.py
185 $TESTTMP/hgrc:15: extensions.plain=./plain.py
172 none: ui.traceback=True
186 none: ui.traceback=True
187 none: ui.verbose=False
173 none: ui.debug=True
188 none: ui.debug=True
189 none: ui.quiet=False
General Comments 0
You need to be logged in to leave comments. Login now