##// END OF EJS Templates
tests: disable a section of `test-hgrc.t` that may hit a zeroconf bug...
Matt Harbison -
r53048:74e16d8c stable
parent child Browse files
Show More
@@ -1,309 +1,313
1 Use hgrc within $TESTTMP
1 Use hgrc within $TESTTMP
2
2
3 $ HGRCPATH=`pwd`/hgrc
3 $ HGRCPATH=`pwd`/hgrc
4 $ export HGRCPATH
4 $ export HGRCPATH
5
5
6 hide outer repo
6 hide outer repo
7 $ hg init
7 $ hg init
8
8
9 Use an alternate var for scribbling on hgrc to keep check-code from
9 Use an alternate var for scribbling on hgrc to keep check-code from
10 complaining about the important settings we may be overwriting:
10 complaining about the important settings we may be overwriting:
11
11
12 $ HGRC=`pwd`/hgrc
12 $ HGRC=`pwd`/hgrc
13 $ export HGRC
13 $ export HGRC
14
14
15 Basic syntax error
15 Basic syntax error
16
16
17 $ echo "invalid" > $HGRC
17 $ echo "invalid" > $HGRC
18 $ hg version
18 $ hg version
19 config error at $TESTTMP/hgrc:1: invalid
19 config error at $TESTTMP/hgrc:1: invalid
20 [255]
20 [255]
21 $ echo "" > $HGRC
21 $ echo "" > $HGRC
22
22
23 Issue1199: Can't use '%' in hgrc (eg url encoded username)
23 Issue1199: Can't use '%' in hgrc (eg url encoded username)
24
24
25 $ hg init "foo%bar"
25 $ hg init "foo%bar"
26 $ hg clone "foo%bar" foobar
26 $ hg clone "foo%bar" foobar
27 updating to branch default
27 updating to branch default
28 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 $ cd foobar
29 $ cd foobar
30 $ cat .hg/hgrc
30 $ cat .hg/hgrc
31 # example repository config (see 'hg help config' for more info)
31 # example repository config (see 'hg help config' for more info)
32 [paths]
32 [paths]
33 default = $TESTTMP/foo%bar
33 default = $TESTTMP/foo%bar
34
34
35 # path aliases to other clones of this repo in URLs or filesystem paths
35 # path aliases to other clones of this repo in URLs or filesystem paths
36 # (see 'hg help config.paths' for more info)
36 # (see 'hg help config.paths' for more info)
37 #
37 #
38 # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
38 # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
39 # my-fork = ssh://jdoe@example.net/hg/jdoes-fork
39 # my-fork = ssh://jdoe@example.net/hg/jdoes-fork
40 # my-clone = /home/jdoe/jdoes-clone
40 # my-clone = /home/jdoe/jdoes-clone
41
41
42 [ui]
42 [ui]
43 # name and email (local to this repository, optional), e.g.
43 # name and email (local to this repository, optional), e.g.
44 # username = Jane Doe <jdoe@example.com>
44 # username = Jane Doe <jdoe@example.com>
45 $ hg paths
45 $ hg paths
46 default = $TESTTMP/foo%bar
46 default = $TESTTMP/foo%bar
47 $ hg showconfig
47 $ hg showconfig
48 bundle.mainreporoot=$TESTTMP/foobar
48 bundle.mainreporoot=$TESTTMP/foobar
49 paths.default=$TESTTMP/foo%bar
49 paths.default=$TESTTMP/foo%bar
50 $ cd ..
50 $ cd ..
51
51
52 Check %include
52 Check %include
53
53
54 $ echo '[section]' > $TESTTMP/included
54 $ echo '[section]' > $TESTTMP/included
55 $ echo 'option = value' >> $TESTTMP/included
55 $ echo 'option = value' >> $TESTTMP/included
56 $ echo '%include $TESTTMP/included' >> $HGRC
56 $ echo '%include $TESTTMP/included' >> $HGRC
57 $ hg showconfig section
57 $ hg showconfig section
58 section.option=value
58 section.option=value
59 #if unix-permissions no-root
59 #if unix-permissions no-root
60 $ chmod u-r $TESTTMP/included
60 $ chmod u-r $TESTTMP/included
61 $ hg showconfig section
61 $ hg showconfig section
62 config error at $TESTTMP/hgrc:2: cannot include $TESTTMP/included ($EACCES$*) (glob)
62 config error at $TESTTMP/hgrc:2: cannot include $TESTTMP/included ($EACCES$*) (glob)
63 [255]
63 [255]
64 #endif
64 #endif
65
65
66 issue1829: wrong indentation
66 issue1829: wrong indentation
67
67
68 $ echo '[foo]' > $HGRC
68 $ echo '[foo]' > $HGRC
69 $ echo ' x = y' >> $HGRC
69 $ echo ' x = y' >> $HGRC
70 $ hg version
70 $ hg version
71 config error at $TESTTMP/hgrc:2: unexpected leading whitespace: x = y
71 config error at $TESTTMP/hgrc:2: unexpected leading whitespace: x = y
72 [255]
72 [255]
73
73
74 $ "$PYTHON" -c "print('[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n')" \
74 $ "$PYTHON" -c "print('[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n')" \
75 > > $HGRC
75 > > $HGRC
76 $ hg showconfig foo
76 $ hg showconfig foo
77 foo.bar=a\nb\nc\nde\nfg
77 foo.bar=a\nb\nc\nde\nfg
78 foo.baz=bif cb
78 foo.baz=bif cb
79
79
80 $ FAKEPATH=/path/to/nowhere
80 $ FAKEPATH=/path/to/nowhere
81 $ export FAKEPATH
81 $ export FAKEPATH
82 $ echo '%include $FAKEPATH/no-such-file' > $HGRC
82 $ echo '%include $FAKEPATH/no-such-file' > $HGRC
83 $ hg version
83 $ hg version
84 Mercurial Distributed SCM (version *) (glob)
84 Mercurial Distributed SCM (version *) (glob)
85 (see https://mercurial-scm.org for more information)
85 (see https://mercurial-scm.org for more information)
86
86
87 Copyright (C) 2005-* Olivia Mackall and others (glob)
87 Copyright (C) 2005-* Olivia Mackall and others (glob)
88 This is free software; see the source for copying conditions. There is NO
88 This is free software; see the source for copying conditions. There is NO
89 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
89 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
90 $ unset FAKEPATH
90 $ unset FAKEPATH
91
91
92 make sure global options given on the cmdline take precedence
92 make sure global options given on the cmdline take precedence
93
93
94 $ hg showconfig --config ui.verbose=True --quiet
94 $ hg showconfig --config ui.verbose=True --quiet
95 bundle.mainreporoot=$TESTTMP
95 bundle.mainreporoot=$TESTTMP
96 ui.verbose=False
96 ui.verbose=False
97 ui.debug=False
97 ui.debug=False
98 ui.quiet=True
98 ui.quiet=True
99
99
100 $ touch foobar/untracked
100 $ touch foobar/untracked
101 $ cat >> foobar/.hg/hgrc <<EOF
101 $ cat >> foobar/.hg/hgrc <<EOF
102 > [ui]
102 > [ui]
103 > verbose=True
103 > verbose=True
104 > EOF
104 > EOF
105 $ hg -R foobar st -q
105 $ hg -R foobar st -q
106
106
107 username expansion
107 username expansion
108
108
109 $ olduser=$HGUSER
109 $ olduser=$HGUSER
110 $ unset HGUSER
110 $ unset HGUSER
111
111
112 $ FAKEUSER='John Doe'
112 $ FAKEUSER='John Doe'
113 $ export FAKEUSER
113 $ export FAKEUSER
114 $ echo '[ui]' > $HGRC
114 $ echo '[ui]' > $HGRC
115 $ echo 'username = $FAKEUSER' >> $HGRC
115 $ echo 'username = $FAKEUSER' >> $HGRC
116
116
117 $ hg init usertest
117 $ hg init usertest
118 $ cd usertest
118 $ cd usertest
119 $ touch bar
119 $ touch bar
120 $ hg commit --addremove --quiet -m "added bar"
120 $ hg commit --addremove --quiet -m "added bar"
121 $ hg log --template "{author}\n"
121 $ hg log --template "{author}\n"
122 John Doe
122 John Doe
123 $ cd ..
123 $ cd ..
124
124
125 $ hg showconfig
125 $ hg showconfig
126 bundle.mainreporoot=$TESTTMP
126 bundle.mainreporoot=$TESTTMP
127 ui.username=$FAKEUSER
127 ui.username=$FAKEUSER
128
128
129 $ unset FAKEUSER
129 $ unset FAKEUSER
130 $ HGUSER=$olduser
130 $ HGUSER=$olduser
131 $ export HGUSER
131 $ export HGUSER
132
132
133 showconfig with multiple arguments
133 showconfig with multiple arguments
134
134
135 $ echo "[alias]" > $HGRC
135 $ echo "[alias]" > $HGRC
136 $ echo "log = log -g" >> $HGRC
136 $ echo "log = log -g" >> $HGRC
137 $ echo "[defaults]" >> $HGRC
137 $ echo "[defaults]" >> $HGRC
138 $ echo "identify = -n" >> $HGRC
138 $ echo "identify = -n" >> $HGRC
139 $ hg showconfig alias defaults
139 $ hg showconfig alias defaults
140 alias.log=log -g
140 alias.log=log -g
141 defaults.identify=-n
141 defaults.identify=-n
142 $ hg showconfig alias alias
142 $ hg showconfig alias alias
143 alias.log=log -g
143 alias.log=log -g
144 $ hg showconfig alias.log alias.log
144 $ hg showconfig alias.log alias.log
145 alias.log=log -g
145 alias.log=log -g
146 $ hg showconfig alias defaults.identify
146 $ hg showconfig alias defaults.identify
147 alias.log=log -g
147 alias.log=log -g
148 defaults.identify=-n
148 defaults.identify=-n
149 $ hg showconfig alias.log defaults.identify
149 $ hg showconfig alias.log defaults.identify
150 alias.log=log -g
150 alias.log=log -g
151 defaults.identify=-n
151 defaults.identify=-n
152
152
153 HGPLAIN
153 HGPLAIN
154
154
155 $ echo "[ui]" > $HGRC
155 $ echo "[ui]" > $HGRC
156 $ echo "debug=true" >> $HGRC
156 $ echo "debug=true" >> $HGRC
157 $ echo "fallbackencoding=ASCII" >> $HGRC
157 $ echo "fallbackencoding=ASCII" >> $HGRC
158 $ echo "quiet=true" >> $HGRC
158 $ echo "quiet=true" >> $HGRC
159 $ echo "slash=true" >> $HGRC
159 $ echo "slash=true" >> $HGRC
160 $ echo "traceback=true" >> $HGRC
160 $ echo "traceback=true" >> $HGRC
161 $ echo "verbose=true" >> $HGRC
161 $ echo "verbose=true" >> $HGRC
162 $ echo "style=~/.hgstyle" >> $HGRC
162 $ echo "style=~/.hgstyle" >> $HGRC
163 $ echo "logtemplate={node}" >> $HGRC
163 $ echo "logtemplate={node}" >> $HGRC
164 $ echo "[defaults]" >> $HGRC
164 $ echo "[defaults]" >> $HGRC
165 $ echo "identify=-n" >> $HGRC
165 $ echo "identify=-n" >> $HGRC
166 $ echo "[alias]" >> $HGRC
166 $ echo "[alias]" >> $HGRC
167 $ echo "log=log -g" >> $HGRC
167 $ echo "log=log -g" >> $HGRC
168
168
169 customized hgrc
169 customized hgrc
170
170
171 $ hg showconfig
171 $ hg showconfig
172 read config from: $TESTTMP/hgrc
172 read config from: $TESTTMP/hgrc
173 $TESTTMP/hgrc:13: alias.log=log -g
173 $TESTTMP/hgrc:13: alias.log=log -g
174 repo: bundle.mainreporoot=$TESTTMP
174 repo: bundle.mainreporoot=$TESTTMP
175 $TESTTMP/hgrc:11: defaults.identify=-n
175 $TESTTMP/hgrc:11: defaults.identify=-n
176 $TESTTMP/hgrc:2: ui.debug=true
176 $TESTTMP/hgrc:2: ui.debug=true
177 $TESTTMP/hgrc:3: ui.fallbackencoding=ASCII
177 $TESTTMP/hgrc:3: ui.fallbackencoding=ASCII
178 $TESTTMP/hgrc:4: ui.quiet=true
178 $TESTTMP/hgrc:4: ui.quiet=true
179 $TESTTMP/hgrc:5: ui.slash=true
179 $TESTTMP/hgrc:5: ui.slash=true
180 $TESTTMP/hgrc:6: ui.traceback=true
180 $TESTTMP/hgrc:6: ui.traceback=true
181 $TESTTMP/hgrc:7: ui.verbose=true
181 $TESTTMP/hgrc:7: ui.verbose=true
182 $TESTTMP/hgrc:8: ui.style=~/.hgstyle
182 $TESTTMP/hgrc:8: ui.style=~/.hgstyle
183 $TESTTMP/hgrc:9: ui.logtemplate={node}
183 $TESTTMP/hgrc:9: ui.logtemplate={node}
184
184
185 plain hgrc
185 plain hgrc
186
186
187 $ HGPLAIN=; export HGPLAIN
187 $ HGPLAIN=; export HGPLAIN
188 $ hg showconfig --config ui.traceback=True --debug
188 $ hg showconfig --config ui.traceback=True --debug
189 read config from: $TESTTMP/hgrc
189 read config from: $TESTTMP/hgrc
190 repo: bundle.mainreporoot=$TESTTMP
190 repo: bundle.mainreporoot=$TESTTMP
191 --config: ui.traceback=True
191 --config: ui.traceback=True
192 --verbose: ui.verbose=False
192 --verbose: ui.verbose=False
193 --debug: ui.debug=True
193 --debug: ui.debug=True
194 --quiet: ui.quiet=False
194 --quiet: ui.quiet=False
195
195
196 with environment variables
196 with environment variables
197
197
198 $ PAGER=p1 EDITOR=e1 VISUAL=e2 hg showconfig --debug
198 $ PAGER=p1 EDITOR=e1 VISUAL=e2 hg showconfig --debug
199 read config from: $TESTTMP/hgrc
199 read config from: $TESTTMP/hgrc
200 repo: bundle.mainreporoot=$TESTTMP
200 repo: bundle.mainreporoot=$TESTTMP
201 $PAGER: pager.pager=p1
201 $PAGER: pager.pager=p1
202 $VISUAL: ui.editor=e2
202 $VISUAL: ui.editor=e2
203 --verbose: ui.verbose=False
203 --verbose: ui.verbose=False
204 --debug: ui.debug=True
204 --debug: ui.debug=True
205 --quiet: ui.quiet=False
205 --quiet: ui.quiet=False
206
206
207 plain mode with exceptions
207 plain mode with exceptions
208
208
209 $ cat > plain.py <<EOF
209 $ cat > plain.py <<EOF
210 > from mercurial import commands, extensions
210 > from mercurial import commands, extensions
211 > def _config(orig, ui, repo, *values, **opts):
211 > def _config(orig, ui, repo, *values, **opts):
212 > ui.write(b'plain: %r\n' % ui.plain())
212 > ui.write(b'plain: %r\n' % ui.plain())
213 > return orig(ui, repo, *values, **opts)
213 > return orig(ui, repo, *values, **opts)
214 > def uisetup(ui):
214 > def uisetup(ui):
215 > extensions.wrapcommand(commands.table, b'config', _config)
215 > extensions.wrapcommand(commands.table, b'config', _config)
216 > EOF
216 > EOF
217 $ echo "[extensions]" >> $HGRC
217 $ echo "[extensions]" >> $HGRC
218 $ echo "plain=./plain.py" >> $HGRC
218 $ echo "plain=./plain.py" >> $HGRC
219 $ HGPLAINEXCEPT=; export HGPLAINEXCEPT
219 $ HGPLAINEXCEPT=; export HGPLAINEXCEPT
220 $ hg showconfig --config ui.traceback=True --debug
220 $ hg showconfig --config ui.traceback=True --debug
221 plain: True
221 plain: True
222 read config from: $TESTTMP/hgrc
222 read config from: $TESTTMP/hgrc
223 repo: bundle.mainreporoot=$TESTTMP
223 repo: bundle.mainreporoot=$TESTTMP
224 $TESTTMP/hgrc:15: extensions.plain=./plain.py
224 $TESTTMP/hgrc:15: extensions.plain=./plain.py
225 --config: ui.traceback=True
225 --config: ui.traceback=True
226 --verbose: ui.verbose=False
226 --verbose: ui.verbose=False
227 --debug: ui.debug=True
227 --debug: ui.debug=True
228 --quiet: ui.quiet=False
228 --quiet: ui.quiet=False
229 $ unset HGPLAIN
229 $ unset HGPLAIN
230 $ hg showconfig --config ui.traceback=True --debug
230 $ hg showconfig --config ui.traceback=True --debug
231 plain: True
231 plain: True
232 read config from: $TESTTMP/hgrc
232 read config from: $TESTTMP/hgrc
233 repo: bundle.mainreporoot=$TESTTMP
233 repo: bundle.mainreporoot=$TESTTMP
234 $TESTTMP/hgrc:15: extensions.plain=./plain.py
234 $TESTTMP/hgrc:15: extensions.plain=./plain.py
235 --config: ui.traceback=True
235 --config: ui.traceback=True
236 --verbose: ui.verbose=False
236 --verbose: ui.verbose=False
237 --debug: ui.debug=True
237 --debug: ui.debug=True
238 --quiet: ui.quiet=False
238 --quiet: ui.quiet=False
239 $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT
239 $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT
240 $ hg showconfig --config ui.traceback=True --debug
240 $ hg showconfig --config ui.traceback=True --debug
241 plain: True
241 plain: True
242 read config from: $TESTTMP/hgrc
242 read config from: $TESTTMP/hgrc
243 repo: bundle.mainreporoot=$TESTTMP
243 repo: bundle.mainreporoot=$TESTTMP
244 $TESTTMP/hgrc:15: extensions.plain=./plain.py
244 $TESTTMP/hgrc:15: extensions.plain=./plain.py
245 --config: ui.traceback=True
245 --config: ui.traceback=True
246 --verbose: ui.verbose=False
246 --verbose: ui.verbose=False
247 --debug: ui.debug=True
247 --debug: ui.debug=True
248 --quiet: ui.quiet=False
248 --quiet: ui.quiet=False
249
249
250 source of paths is not mangled
250 source of paths is not mangled
251
251
252 $ cat >> $HGRCPATH <<EOF
252 $ cat >> $HGRCPATH <<EOF
253 > [paths]
253 > [paths]
254 > foo = bar
254 > foo = bar
255 > EOF
255 > EOF
256 $ hg showconfig --source paths
256 $ hg showconfig --source paths
257 plain: True
257 plain: True
258 $TESTTMP/hgrc:17: paths.foo=bar
258 $TESTTMP/hgrc:17: paths.foo=bar
259
259
260 Test we can skip the user configuration
260 Test we can skip the user configuration
261
261
262 $ cat >> .hg/hgrc <<EOF
262 $ cat >> .hg/hgrc <<EOF
263 > [paths]
263 > [paths]
264 > elephant = babar
264 > elephant = babar
265 > EOF
265 > EOF
266 $ hg path
266 $ hg path
267 elephant = $TESTTMP/babar
267 elephant = $TESTTMP/babar
268 foo = $TESTTMP/bar
268 foo = $TESTTMP/bar
269 $ HGRCSKIPREPO=1 hg path
269 $ HGRCSKIPREPO=1 hg path
270 foo = $TESTTMP/bar
270 foo = $TESTTMP/bar
271
271
272 $ cat >> .hg/hgrc <<EOF
272 $ cat >> .hg/hgrc <<EOF
273 > [broken
273 > [broken
274 > EOF
274 > EOF
275
275
276 $ hg path
276 $ hg path
277 config error at $TESTTMP/.hg/hgrc:3: [broken
277 config error at $TESTTMP/.hg/hgrc:3: [broken
278 [255]
278 [255]
279 $ HGRCSKIPREPO=1 hg path
279 $ HGRCSKIPREPO=1 hg path
280 foo = $TESTTMP/bar
280 foo = $TESTTMP/bar
281
281
282 Check that hgweb respect HGRCSKIPREPO=1
282 Check that hgweb respect HGRCSKIPREPO=1
283
283
284 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
284 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
285 config error at $TESTTMP/.hg/hgrc:3: [broken
285 config error at $TESTTMP/.hg/hgrc:3: [broken
286 [255]
286 [255]
287 $ test -f hg.pid && (cat hg.pid >> $DAEMON_PIDS)
287 $ test -f hg.pid && (cat hg.pid >> $DAEMON_PIDS)
288 [1]
288 [1]
289 $ killdaemons.py
289 $ killdaemons.py
290 $ test -f access.log && cat access.log
290 $ test -f access.log && cat access.log
291 [1]
291 [1]
292 $ test -f errors.log && cat errors.log
292 $ test -f errors.log && cat errors.log
293 [1]
293 [1]
294
294
295 $ HGRCSKIPREPO=1 hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
295 $ HGRCSKIPREPO=1 hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
296 $ cat hg.pid >> $DAEMON_PIDS
296 $ cat hg.pid >> $DAEMON_PIDS
297 $ killdaemons.py
297 $ killdaemons.py
298 $ cat access.log
298 $ cat access.log
299 $ cat errors.log
299 $ cat errors.log
300
300
301 Check that zeroconf respect HGRCSKIPREPO=1
301 Check that zeroconf respect HGRCSKIPREPO=1
302
302
303 $ hg paths --config extensions.zeroconf=
303 $ hg paths --config extensions.zeroconf=
304 config error at $TESTTMP/.hg/hgrc:3: [broken
304 config error at $TESTTMP/.hg/hgrc:3: [broken
305 [255]
305 [255]
306
306
307 XXX: This occasionally crashes with a bytes vs str problem when processing a
308 packet response, so disable it for now.
309
310 #if missing-correct-output
307 $ HGRCSKIPREPO=1 hg paths --config extensions.zeroconf=
311 $ HGRCSKIPREPO=1 hg paths --config extensions.zeroconf=
308 foo = $TESTTMP/bar
312 foo = $TESTTMP/bar
309
313 #endif
General Comments 0
You need to be logged in to leave comments. Login now