##// END OF EJS Templates
tests: Disable for rhg remaining tests that fail in that mode...
Simon Sapin -
r47483:5a2212d4 default
parent child Browse files
Show More
@@ -1,501 +1,504 b''
1 hide outer repo
1 hide outer repo
2 $ hg init
2 $ hg init
3
3
4 Invalid syntax: no value
4 Invalid syntax: no value
5
5
6 TODO: add rhg support for detailed exit codes
7 #if no-rhg
6 $ cat > .hg/hgrc << EOF
8 $ cat > .hg/hgrc << EOF
7 > novaluekey
9 > novaluekey
8 > EOF
10 > EOF
9 $ hg showconfig
11 $ hg showconfig
10 config error at $TESTTMP/.hg/hgrc:1: novaluekey
12 config error at $TESTTMP/.hg/hgrc:1: novaluekey
11 [30]
13 [30]
12
14
13 Invalid syntax: no key
15 Invalid syntax: no key
14
16
15 $ cat > .hg/hgrc << EOF
17 $ cat > .hg/hgrc << EOF
16 > =nokeyvalue
18 > =nokeyvalue
17 > EOF
19 > EOF
18 $ hg showconfig
20 $ hg showconfig
19 config error at $TESTTMP/.hg/hgrc:1: =nokeyvalue
21 config error at $TESTTMP/.hg/hgrc:1: =nokeyvalue
20 [30]
22 [30]
21
23
22 Test hint about invalid syntax from leading white space
24 Test hint about invalid syntax from leading white space
23
25
24 $ cat > .hg/hgrc << EOF
26 $ cat > .hg/hgrc << EOF
25 > key=value
27 > key=value
26 > EOF
28 > EOF
27 $ hg showconfig
29 $ hg showconfig
28 config error at $TESTTMP/.hg/hgrc:1: unexpected leading whitespace: key=value
30 config error at $TESTTMP/.hg/hgrc:1: unexpected leading whitespace: key=value
29 [30]
31 [30]
30
32
31 $ cat > .hg/hgrc << EOF
33 $ cat > .hg/hgrc << EOF
32 > [section]
34 > [section]
33 > key=value
35 > key=value
34 > EOF
36 > EOF
35 $ hg showconfig
37 $ hg showconfig
36 config error at $TESTTMP/.hg/hgrc:1: unexpected leading whitespace: [section]
38 config error at $TESTTMP/.hg/hgrc:1: unexpected leading whitespace: [section]
37 [30]
39 [30]
40 #endif
38
41
39 Reset hgrc
42 Reset hgrc
40
43
41 $ echo > .hg/hgrc
44 $ echo > .hg/hgrc
42
45
43 Test case sensitive configuration
46 Test case sensitive configuration
44
47
45 $ cat <<EOF >> $HGRCPATH
48 $ cat <<EOF >> $HGRCPATH
46 > [Section]
49 > [Section]
47 > KeY = Case Sensitive
50 > KeY = Case Sensitive
48 > key = lower case
51 > key = lower case
49 > EOF
52 > EOF
50
53
51 $ hg showconfig Section
54 $ hg showconfig Section
52 Section.KeY=Case Sensitive
55 Section.KeY=Case Sensitive
53 Section.key=lower case
56 Section.key=lower case
54
57
55 $ hg showconfig Section -Tjson
58 $ hg showconfig Section -Tjson
56 [
59 [
57 {
60 {
58 "defaultvalue": null,
61 "defaultvalue": null,
59 "name": "Section.KeY",
62 "name": "Section.KeY",
60 "source": "*.hgrc:*", (glob)
63 "source": "*.hgrc:*", (glob)
61 "value": "Case Sensitive"
64 "value": "Case Sensitive"
62 },
65 },
63 {
66 {
64 "defaultvalue": null,
67 "defaultvalue": null,
65 "name": "Section.key",
68 "name": "Section.key",
66 "source": "*.hgrc:*", (glob)
69 "source": "*.hgrc:*", (glob)
67 "value": "lower case"
70 "value": "lower case"
68 }
71 }
69 ]
72 ]
70 $ hg showconfig Section.KeY -Tjson
73 $ hg showconfig Section.KeY -Tjson
71 [
74 [
72 {
75 {
73 "defaultvalue": null,
76 "defaultvalue": null,
74 "name": "Section.KeY",
77 "name": "Section.KeY",
75 "source": "*.hgrc:*", (glob)
78 "source": "*.hgrc:*", (glob)
76 "value": "Case Sensitive"
79 "value": "Case Sensitive"
77 }
80 }
78 ]
81 ]
79 $ hg showconfig -Tjson | tail -7
82 $ hg showconfig -Tjson | tail -7
80 {
83 {
81 "defaultvalue": null,
84 "defaultvalue": null,
82 "name": "*", (glob)
85 "name": "*", (glob)
83 "source": "*", (glob)
86 "source": "*", (glob)
84 "value": "*" (glob)
87 "value": "*" (glob)
85 }
88 }
86 ]
89 ]
87
90
88 Test config default of various types:
91 Test config default of various types:
89
92
90 {"defaultvalue": ""} for -T'json(defaultvalue)' looks weird, but that's
93 {"defaultvalue": ""} for -T'json(defaultvalue)' looks weird, but that's
91 how the templater works. Unknown keywords are evaluated to "".
94 how the templater works. Unknown keywords are evaluated to "".
92
95
93 dynamicdefault
96 dynamicdefault
94
97
95 $ hg config --config alias.foo= alias -Tjson
98 $ hg config --config alias.foo= alias -Tjson
96 [
99 [
97 {
100 {
98 "name": "alias.foo",
101 "name": "alias.foo",
99 "source": "--config",
102 "source": "--config",
100 "value": ""
103 "value": ""
101 }
104 }
102 ]
105 ]
103 $ hg config --config alias.foo= alias -T'json(defaultvalue)'
106 $ hg config --config alias.foo= alias -T'json(defaultvalue)'
104 [
107 [
105 {"defaultvalue": ""}
108 {"defaultvalue": ""}
106 ]
109 ]
107 $ hg config --config alias.foo= alias -T'{defaultvalue}\n'
110 $ hg config --config alias.foo= alias -T'{defaultvalue}\n'
108
111
109
112
110 null
113 null
111
114
112 $ hg config --config auth.cookiefile= auth -Tjson
115 $ hg config --config auth.cookiefile= auth -Tjson
113 [
116 [
114 {
117 {
115 "defaultvalue": null,
118 "defaultvalue": null,
116 "name": "auth.cookiefile",
119 "name": "auth.cookiefile",
117 "source": "--config",
120 "source": "--config",
118 "value": ""
121 "value": ""
119 }
122 }
120 ]
123 ]
121 $ hg config --config auth.cookiefile= auth -T'json(defaultvalue)'
124 $ hg config --config auth.cookiefile= auth -T'json(defaultvalue)'
122 [
125 [
123 {"defaultvalue": null}
126 {"defaultvalue": null}
124 ]
127 ]
125 $ hg config --config auth.cookiefile= auth -T'{defaultvalue}\n'
128 $ hg config --config auth.cookiefile= auth -T'{defaultvalue}\n'
126
129
127
130
128 false
131 false
129
132
130 $ hg config --config commands.commit.post-status= commands -Tjson
133 $ hg config --config commands.commit.post-status= commands -Tjson
131 [
134 [
132 {
135 {
133 "defaultvalue": false,
136 "defaultvalue": false,
134 "name": "commands.commit.post-status",
137 "name": "commands.commit.post-status",
135 "source": "--config",
138 "source": "--config",
136 "value": ""
139 "value": ""
137 }
140 }
138 ]
141 ]
139 $ hg config --config commands.commit.post-status= commands -T'json(defaultvalue)'
142 $ hg config --config commands.commit.post-status= commands -T'json(defaultvalue)'
140 [
143 [
141 {"defaultvalue": false}
144 {"defaultvalue": false}
142 ]
145 ]
143 $ hg config --config commands.commit.post-status= commands -T'{defaultvalue}\n'
146 $ hg config --config commands.commit.post-status= commands -T'{defaultvalue}\n'
144 False
147 False
145
148
146 true
149 true
147
150
148 $ hg config --config format.dotencode= format -Tjson
151 $ hg config --config format.dotencode= format -Tjson
149 [
152 [
150 {
153 {
151 "defaultvalue": true,
154 "defaultvalue": true,
152 "name": "format.dotencode",
155 "name": "format.dotencode",
153 "source": "--config",
156 "source": "--config",
154 "value": ""
157 "value": ""
155 }
158 }
156 ]
159 ]
157 $ hg config --config format.dotencode= format -T'json(defaultvalue)'
160 $ hg config --config format.dotencode= format -T'json(defaultvalue)'
158 [
161 [
159 {"defaultvalue": true}
162 {"defaultvalue": true}
160 ]
163 ]
161 $ hg config --config format.dotencode= format -T'{defaultvalue}\n'
164 $ hg config --config format.dotencode= format -T'{defaultvalue}\n'
162 True
165 True
163
166
164 bytes
167 bytes
165
168
166 $ hg config --config commands.resolve.mark-check= commands -Tjson
169 $ hg config --config commands.resolve.mark-check= commands -Tjson
167 [
170 [
168 {
171 {
169 "defaultvalue": "none",
172 "defaultvalue": "none",
170 "name": "commands.resolve.mark-check",
173 "name": "commands.resolve.mark-check",
171 "source": "--config",
174 "source": "--config",
172 "value": ""
175 "value": ""
173 }
176 }
174 ]
177 ]
175 $ hg config --config commands.resolve.mark-check= commands -T'json(defaultvalue)'
178 $ hg config --config commands.resolve.mark-check= commands -T'json(defaultvalue)'
176 [
179 [
177 {"defaultvalue": "none"}
180 {"defaultvalue": "none"}
178 ]
181 ]
179 $ hg config --config commands.resolve.mark-check= commands -T'{defaultvalue}\n'
182 $ hg config --config commands.resolve.mark-check= commands -T'{defaultvalue}\n'
180 none
183 none
181
184
182 empty list
185 empty list
183
186
184 $ hg config --config commands.show.aliasprefix= commands -Tjson
187 $ hg config --config commands.show.aliasprefix= commands -Tjson
185 [
188 [
186 {
189 {
187 "defaultvalue": [],
190 "defaultvalue": [],
188 "name": "commands.show.aliasprefix",
191 "name": "commands.show.aliasprefix",
189 "source": "--config",
192 "source": "--config",
190 "value": ""
193 "value": ""
191 }
194 }
192 ]
195 ]
193 $ hg config --config commands.show.aliasprefix= commands -T'json(defaultvalue)'
196 $ hg config --config commands.show.aliasprefix= commands -T'json(defaultvalue)'
194 [
197 [
195 {"defaultvalue": []}
198 {"defaultvalue": []}
196 ]
199 ]
197 $ hg config --config commands.show.aliasprefix= commands -T'{defaultvalue}\n'
200 $ hg config --config commands.show.aliasprefix= commands -T'{defaultvalue}\n'
198
201
199
202
200 nonempty list
203 nonempty list
201
204
202 $ hg config --config progress.format= progress -Tjson
205 $ hg config --config progress.format= progress -Tjson
203 [
206 [
204 {
207 {
205 "defaultvalue": ["topic", "bar", "number", "estimate"],
208 "defaultvalue": ["topic", "bar", "number", "estimate"],
206 "name": "progress.format",
209 "name": "progress.format",
207 "source": "--config",
210 "source": "--config",
208 "value": ""
211 "value": ""
209 }
212 }
210 ]
213 ]
211 $ hg config --config progress.format= progress -T'json(defaultvalue)'
214 $ hg config --config progress.format= progress -T'json(defaultvalue)'
212 [
215 [
213 {"defaultvalue": ["topic", "bar", "number", "estimate"]}
216 {"defaultvalue": ["topic", "bar", "number", "estimate"]}
214 ]
217 ]
215 $ hg config --config progress.format= progress -T'{defaultvalue}\n'
218 $ hg config --config progress.format= progress -T'{defaultvalue}\n'
216 topic bar number estimate
219 topic bar number estimate
217
220
218 int
221 int
219
222
220 $ hg config --config profiling.freq= profiling -Tjson
223 $ hg config --config profiling.freq= profiling -Tjson
221 [
224 [
222 {
225 {
223 "defaultvalue": 1000,
226 "defaultvalue": 1000,
224 "name": "profiling.freq",
227 "name": "profiling.freq",
225 "source": "--config",
228 "source": "--config",
226 "value": ""
229 "value": ""
227 }
230 }
228 ]
231 ]
229 $ hg config --config profiling.freq= profiling -T'json(defaultvalue)'
232 $ hg config --config profiling.freq= profiling -T'json(defaultvalue)'
230 [
233 [
231 {"defaultvalue": 1000}
234 {"defaultvalue": 1000}
232 ]
235 ]
233 $ hg config --config profiling.freq= profiling -T'{defaultvalue}\n'
236 $ hg config --config profiling.freq= profiling -T'{defaultvalue}\n'
234 1000
237 1000
235
238
236 float
239 float
237
240
238 $ hg config --config profiling.showmax= profiling -Tjson
241 $ hg config --config profiling.showmax= profiling -Tjson
239 [
242 [
240 {
243 {
241 "defaultvalue": 0.999,
244 "defaultvalue": 0.999,
242 "name": "profiling.showmax",
245 "name": "profiling.showmax",
243 "source": "--config",
246 "source": "--config",
244 "value": ""
247 "value": ""
245 }
248 }
246 ]
249 ]
247 $ hg config --config profiling.showmax= profiling -T'json(defaultvalue)'
250 $ hg config --config profiling.showmax= profiling -T'json(defaultvalue)'
248 [
251 [
249 {"defaultvalue": 0.999}
252 {"defaultvalue": 0.999}
250 ]
253 ]
251 $ hg config --config profiling.showmax= profiling -T'{defaultvalue}\n'
254 $ hg config --config profiling.showmax= profiling -T'{defaultvalue}\n'
252 0.999
255 0.999
253
256
254 Test empty config source:
257 Test empty config source:
255
258
256 $ cat <<EOF > emptysource.py
259 $ cat <<EOF > emptysource.py
257 > def reposetup(ui, repo):
260 > def reposetup(ui, repo):
258 > ui.setconfig(b'empty', b'source', b'value')
261 > ui.setconfig(b'empty', b'source', b'value')
259 > EOF
262 > EOF
260 $ cp .hg/hgrc .hg/hgrc.orig
263 $ cp .hg/hgrc .hg/hgrc.orig
261 $ cat <<EOF >> .hg/hgrc
264 $ cat <<EOF >> .hg/hgrc
262 > [extensions]
265 > [extensions]
263 > emptysource = `pwd`/emptysource.py
266 > emptysource = `pwd`/emptysource.py
264 > EOF
267 > EOF
265
268
266 $ hg config --debug empty.source
269 $ hg config --debug empty.source
267 read config from: * (glob)
270 read config from: * (glob)
268 none: value
271 none: value
269 $ hg config empty.source -Tjson
272 $ hg config empty.source -Tjson
270 [
273 [
271 {
274 {
272 "defaultvalue": null,
275 "defaultvalue": null,
273 "name": "empty.source",
276 "name": "empty.source",
274 "source": "",
277 "source": "",
275 "value": "value"
278 "value": "value"
276 }
279 }
277 ]
280 ]
278
281
279 $ cp .hg/hgrc.orig .hg/hgrc
282 $ cp .hg/hgrc.orig .hg/hgrc
280
283
281 Test "%unset"
284 Test "%unset"
282
285
283 $ cat >> $HGRCPATH <<EOF
286 $ cat >> $HGRCPATH <<EOF
284 > [unsettest]
287 > [unsettest]
285 > local-hgrcpath = should be unset (HGRCPATH)
288 > local-hgrcpath = should be unset (HGRCPATH)
286 > %unset local-hgrcpath
289 > %unset local-hgrcpath
287 >
290 >
288 > global = should be unset (HGRCPATH)
291 > global = should be unset (HGRCPATH)
289 >
292 >
290 > both = should be unset (HGRCPATH)
293 > both = should be unset (HGRCPATH)
291 >
294 >
292 > set-after-unset = should be unset (HGRCPATH)
295 > set-after-unset = should be unset (HGRCPATH)
293 > EOF
296 > EOF
294
297
295 $ cat >> .hg/hgrc <<EOF
298 $ cat >> .hg/hgrc <<EOF
296 > [unsettest]
299 > [unsettest]
297 > local-hgrc = should be unset (.hg/hgrc)
300 > local-hgrc = should be unset (.hg/hgrc)
298 > %unset local-hgrc
301 > %unset local-hgrc
299 >
302 >
300 > %unset global
303 > %unset global
301 >
304 >
302 > both = should be unset (.hg/hgrc)
305 > both = should be unset (.hg/hgrc)
303 > %unset both
306 > %unset both
304 >
307 >
305 > set-after-unset = should be unset (.hg/hgrc)
308 > set-after-unset = should be unset (.hg/hgrc)
306 > %unset set-after-unset
309 > %unset set-after-unset
307 > set-after-unset = should be set (.hg/hgrc)
310 > set-after-unset = should be set (.hg/hgrc)
308 > EOF
311 > EOF
309
312
310 $ hg showconfig unsettest
313 $ hg showconfig unsettest
311 unsettest.set-after-unset=should be set (.hg/hgrc)
314 unsettest.set-after-unset=should be set (.hg/hgrc)
312
315
313 Test exit code when no config matches
316 Test exit code when no config matches
314
317
315 $ hg config Section.idontexist
318 $ hg config Section.idontexist
316 [1]
319 [1]
317
320
318 sub-options in [paths] aren't expanded
321 sub-options in [paths] aren't expanded
319
322
320 $ cat > .hg/hgrc << EOF
323 $ cat > .hg/hgrc << EOF
321 > [paths]
324 > [paths]
322 > foo = ~/foo
325 > foo = ~/foo
323 > foo:suboption = ~/foo
326 > foo:suboption = ~/foo
324 > EOF
327 > EOF
325
328
326 $ hg showconfig paths
329 $ hg showconfig paths
327 paths.foo:suboption=~/foo
330 paths.foo:suboption=~/foo
328 paths.foo=$TESTTMP/foo
331 paths.foo=$TESTTMP/foo
329
332
330 edit failure
333 edit failure
331
334
332 $ HGEDITOR=false hg config --edit
335 $ HGEDITOR=false hg config --edit
333 abort: edit failed: false exited with status 1
336 abort: edit failed: false exited with status 1
334 [10]
337 [10]
335
338
336 config affected by environment variables
339 config affected by environment variables
337
340
338 $ EDITOR=e1 VISUAL=e2 hg config --debug | grep 'ui\.editor'
341 $ EDITOR=e1 VISUAL=e2 hg config --debug | grep 'ui\.editor'
339 $VISUAL: ui.editor=e2
342 $VISUAL: ui.editor=e2
340
343
341 $ VISUAL=e2 hg config --debug --config ui.editor=e3 | grep 'ui\.editor'
344 $ VISUAL=e2 hg config --debug --config ui.editor=e3 | grep 'ui\.editor'
342 --config: ui.editor=e3
345 --config: ui.editor=e3
343
346
344 $ PAGER=p1 hg config --debug | grep 'pager\.pager'
347 $ PAGER=p1 hg config --debug | grep 'pager\.pager'
345 $PAGER: pager.pager=p1
348 $PAGER: pager.pager=p1
346
349
347 $ PAGER=p1 hg config --debug --config pager.pager=p2 | grep 'pager\.pager'
350 $ PAGER=p1 hg config --debug --config pager.pager=p2 | grep 'pager\.pager'
348 --config: pager.pager=p2
351 --config: pager.pager=p2
349
352
350 verify that aliases are evaluated as well
353 verify that aliases are evaluated as well
351
354
352 $ hg init aliastest
355 $ hg init aliastest
353 $ cd aliastest
356 $ cd aliastest
354 $ cat > .hg/hgrc << EOF
357 $ cat > .hg/hgrc << EOF
355 > [ui]
358 > [ui]
356 > user = repo user
359 > user = repo user
357 > EOF
360 > EOF
358 $ touch index
361 $ touch index
359 $ unset HGUSER
362 $ unset HGUSER
360 $ hg ci -Am test
363 $ hg ci -Am test
361 adding index
364 adding index
362 $ hg log --template '{author}\n'
365 $ hg log --template '{author}\n'
363 repo user
366 repo user
364 $ cd ..
367 $ cd ..
365
368
366 alias has lower priority
369 alias has lower priority
367
370
368 $ hg init aliaspriority
371 $ hg init aliaspriority
369 $ cd aliaspriority
372 $ cd aliaspriority
370 $ cat > .hg/hgrc << EOF
373 $ cat > .hg/hgrc << EOF
371 > [ui]
374 > [ui]
372 > user = alias user
375 > user = alias user
373 > username = repo user
376 > username = repo user
374 > EOF
377 > EOF
375 $ touch index
378 $ touch index
376 $ unset HGUSER
379 $ unset HGUSER
377 $ hg ci -Am test
380 $ hg ci -Am test
378 adding index
381 adding index
379 $ hg log --template '{author}\n'
382 $ hg log --template '{author}\n'
380 repo user
383 repo user
381 $ cd ..
384 $ cd ..
382
385
383 configs should be read in lexicographical order
386 configs should be read in lexicographical order
384
387
385 $ mkdir configs
388 $ mkdir configs
386 $ for i in `$TESTDIR/seq.py 10 99`; do
389 $ for i in `$TESTDIR/seq.py 10 99`; do
387 > printf "[section]\nkey=$i" > configs/$i.rc
390 > printf "[section]\nkey=$i" > configs/$i.rc
388 > done
391 > done
389 $ HGRCPATH=configs hg config section.key
392 $ HGRCPATH=configs hg config section.key
390 99
393 99
391
394
392 Configuration priority
395 Configuration priority
393 ======================
396 ======================
394
397
395 setup necessary file
398 setup necessary file
396
399
397 $ cat > file-A.rc << EOF
400 $ cat > file-A.rc << EOF
398 > [config-test]
401 > [config-test]
399 > basic = value-A
402 > basic = value-A
400 > pre-include= value-A
403 > pre-include= value-A
401 > %include ./included.rc
404 > %include ./included.rc
402 > post-include= value-A
405 > post-include= value-A
403 > [command-templates]
406 > [command-templates]
404 > log = "value-A\n"
407 > log = "value-A\n"
405 > EOF
408 > EOF
406
409
407 $ cat > file-B.rc << EOF
410 $ cat > file-B.rc << EOF
408 > [config-test]
411 > [config-test]
409 > basic = value-B
412 > basic = value-B
410 > [ui]
413 > [ui]
411 > logtemplate = "value-B\n"
414 > logtemplate = "value-B\n"
412 > EOF
415 > EOF
413
416
414
417
415 $ cat > included.rc << EOF
418 $ cat > included.rc << EOF
416 > [config-test]
419 > [config-test]
417 > pre-include= value-included
420 > pre-include= value-included
418 > post-include= value-included
421 > post-include= value-included
419 > EOF
422 > EOF
420
423
421 $ cat > file-C.rc << EOF
424 $ cat > file-C.rc << EOF
422 > %include ./included-alias-C.rc
425 > %include ./included-alias-C.rc
423 > [ui]
426 > [ui]
424 > logtemplate = "value-C\n"
427 > logtemplate = "value-C\n"
425 > EOF
428 > EOF
426
429
427 $ cat > included-alias-C.rc << EOF
430 $ cat > included-alias-C.rc << EOF
428 > [command-templates]
431 > [command-templates]
429 > log = "value-included\n"
432 > log = "value-included\n"
430 > EOF
433 > EOF
431
434
432
435
433 $ cat > file-D.rc << EOF
436 $ cat > file-D.rc << EOF
434 > [command-templates]
437 > [command-templates]
435 > log = "value-D\n"
438 > log = "value-D\n"
436 > %include ./included-alias-D.rc
439 > %include ./included-alias-D.rc
437 > EOF
440 > EOF
438
441
439 $ cat > included-alias-D.rc << EOF
442 $ cat > included-alias-D.rc << EOF
440 > [ui]
443 > [ui]
441 > logtemplate = "value-included\n"
444 > logtemplate = "value-included\n"
442 > EOF
445 > EOF
443
446
444 Simple order checking
447 Simple order checking
445 ---------------------
448 ---------------------
446
449
447 If file B is read after file A, value from B overwrite value from A.
450 If file B is read after file A, value from B overwrite value from A.
448
451
449 $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic
452 $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic
450 value-B
453 value-B
451
454
452 Ordering from include
455 Ordering from include
453 ---------------------
456 ---------------------
454
457
455 value from an include overwrite value defined before the include, but not the one defined after the include
458 value from an include overwrite value defined before the include, but not the one defined after the include
456
459
457 $ HGRCPATH="file-A.rc" hg config config-test.pre-include
460 $ HGRCPATH="file-A.rc" hg config config-test.pre-include
458 value-included
461 value-included
459 $ HGRCPATH="file-A.rc" hg config config-test.post-include
462 $ HGRCPATH="file-A.rc" hg config config-test.post-include
460 value-A
463 value-A
461
464
462 command line override
465 command line override
463 ---------------------
466 ---------------------
464
467
465 $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic --config config-test.basic=value-CLI
468 $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic --config config-test.basic=value-CLI
466 value-CLI
469 value-CLI
467
470
468 Alias ordering
471 Alias ordering
469 --------------
472 --------------
470
473
471 The official config is now `command-templates.log`, the historical
474 The official config is now `command-templates.log`, the historical
472 `ui.logtemplate` is a valid alternative for it.
475 `ui.logtemplate` is a valid alternative for it.
473
476
474 When both are defined, The config value read the last "win", this should keep
477 When both are defined, The config value read the last "win", this should keep
475 being true if the config have other alias. In other word, the config value read
478 being true if the config have other alias. In other word, the config value read
476 earlier will be considered "lower level" and the config read later would be
479 earlier will be considered "lower level" and the config read later would be
477 considered "higher level". And higher level values wins.
480 considered "higher level". And higher level values wins.
478
481
479 $ HGRCPATH="file-A.rc" hg log -r .
482 $ HGRCPATH="file-A.rc" hg log -r .
480 value-A
483 value-A
481 $ HGRCPATH="file-B.rc" hg log -r .
484 $ HGRCPATH="file-B.rc" hg log -r .
482 value-B
485 value-B
483 $ HGRCPATH="file-A.rc:file-B.rc" hg log -r .
486 $ HGRCPATH="file-A.rc:file-B.rc" hg log -r .
484 value-B
487 value-B
485
488
486 Alias and include
489 Alias and include
487 -----------------
490 -----------------
488
491
489 The pre/post include priority should also apply when tie-breaking alternatives.
492 The pre/post include priority should also apply when tie-breaking alternatives.
490 See the case above for details about the two config options used.
493 See the case above for details about the two config options used.
491
494
492 $ HGRCPATH="file-C.rc" hg log -r .
495 $ HGRCPATH="file-C.rc" hg log -r .
493 value-C
496 value-C
494 $ HGRCPATH="file-D.rc" hg log -r .
497 $ HGRCPATH="file-D.rc" hg log -r .
495 value-included
498 value-included
496
499
497 command line override
500 command line override
498 ---------------------
501 ---------------------
499
502
500 $ HGRCPATH="file-A.rc:file-B.rc" hg log -r . --config ui.logtemplate="value-CLI\n"
503 $ HGRCPATH="file-A.rc:file-B.rc" hg log -r . --config ui.logtemplate="value-CLI\n"
501 value-CLI
504 value-CLI
@@ -1,664 +1,672 b''
1 $ cat << EOF >> $HGRCPATH
1 $ cat << EOF >> $HGRCPATH
2 > [ui]
2 > [ui]
3 > interactive=yes
3 > interactive=yes
4 > EOF
4 > EOF
5
5
6 $ hg init debugrevlog
6 $ hg init debugrevlog
7 $ cd debugrevlog
7 $ cd debugrevlog
8 $ echo a > a
8 $ echo a > a
9 $ hg ci -Am adda
9 $ hg ci -Am adda
10 adding a
10 adding a
11 $ hg rm .
11 $ hg rm .
12 removing a
12 removing a
13 $ hg ci -Am make-it-empty
13 $ hg ci -Am make-it-empty
14 $ hg revert --all -r 0
14 $ hg revert --all -r 0
15 adding a
15 adding a
16 $ hg ci -Am make-it-full
16 $ hg ci -Am make-it-full
17 #if reporevlogstore
17 #if reporevlogstore
18 $ hg debugrevlog -c
18 $ hg debugrevlog -c
19 format : 1
19 format : 1
20 flags : inline
20 flags : inline
21
21
22 revisions : 3
22 revisions : 3
23 merges : 0 ( 0.00%)
23 merges : 0 ( 0.00%)
24 normal : 3 (100.00%)
24 normal : 3 (100.00%)
25 revisions : 3
25 revisions : 3
26 empty : 0 ( 0.00%)
26 empty : 0 ( 0.00%)
27 text : 0 (100.00%)
27 text : 0 (100.00%)
28 delta : 0 (100.00%)
28 delta : 0 (100.00%)
29 snapshot : 3 (100.00%)
29 snapshot : 3 (100.00%)
30 lvl-0 : 3 (100.00%)
30 lvl-0 : 3 (100.00%)
31 deltas : 0 ( 0.00%)
31 deltas : 0 ( 0.00%)
32 revision size : 191
32 revision size : 191
33 snapshot : 191 (100.00%)
33 snapshot : 191 (100.00%)
34 lvl-0 : 191 (100.00%)
34 lvl-0 : 191 (100.00%)
35 deltas : 0 ( 0.00%)
35 deltas : 0 ( 0.00%)
36
36
37 chunks : 3
37 chunks : 3
38 0x75 (u) : 3 (100.00%)
38 0x75 (u) : 3 (100.00%)
39 chunks size : 191
39 chunks size : 191
40 0x75 (u) : 191 (100.00%)
40 0x75 (u) : 191 (100.00%)
41
41
42 avg chain length : 0
42 avg chain length : 0
43 max chain length : 0
43 max chain length : 0
44 max chain reach : 67
44 max chain reach : 67
45 compression ratio : 0
45 compression ratio : 0
46
46
47 uncompressed data size (min/max/avg) : 57 / 66 / 62
47 uncompressed data size (min/max/avg) : 57 / 66 / 62
48 full revision size (min/max/avg) : 58 / 67 / 63
48 full revision size (min/max/avg) : 58 / 67 / 63
49 inter-snapshot size (min/max/avg) : 0 / 0 / 0
49 inter-snapshot size (min/max/avg) : 0 / 0 / 0
50 delta size (min/max/avg) : 0 / 0 / 0
50 delta size (min/max/avg) : 0 / 0 / 0
51 $ hg debugrevlog -m
51 $ hg debugrevlog -m
52 format : 1
52 format : 1
53 flags : inline, generaldelta
53 flags : inline, generaldelta
54
54
55 revisions : 3
55 revisions : 3
56 merges : 0 ( 0.00%)
56 merges : 0 ( 0.00%)
57 normal : 3 (100.00%)
57 normal : 3 (100.00%)
58 revisions : 3
58 revisions : 3
59 empty : 1 (33.33%)
59 empty : 1 (33.33%)
60 text : 1 (100.00%)
60 text : 1 (100.00%)
61 delta : 0 ( 0.00%)
61 delta : 0 ( 0.00%)
62 snapshot : 2 (66.67%)
62 snapshot : 2 (66.67%)
63 lvl-0 : 2 (66.67%)
63 lvl-0 : 2 (66.67%)
64 deltas : 0 ( 0.00%)
64 deltas : 0 ( 0.00%)
65 revision size : 88
65 revision size : 88
66 snapshot : 88 (100.00%)
66 snapshot : 88 (100.00%)
67 lvl-0 : 88 (100.00%)
67 lvl-0 : 88 (100.00%)
68 deltas : 0 ( 0.00%)
68 deltas : 0 ( 0.00%)
69
69
70 chunks : 3
70 chunks : 3
71 empty : 1 (33.33%)
71 empty : 1 (33.33%)
72 0x75 (u) : 2 (66.67%)
72 0x75 (u) : 2 (66.67%)
73 chunks size : 88
73 chunks size : 88
74 empty : 0 ( 0.00%)
74 empty : 0 ( 0.00%)
75 0x75 (u) : 88 (100.00%)
75 0x75 (u) : 88 (100.00%)
76
76
77 avg chain length : 0
77 avg chain length : 0
78 max chain length : 0
78 max chain length : 0
79 max chain reach : 44
79 max chain reach : 44
80 compression ratio : 0
80 compression ratio : 0
81
81
82 uncompressed data size (min/max/avg) : 0 / 43 / 28
82 uncompressed data size (min/max/avg) : 0 / 43 / 28
83 full revision size (min/max/avg) : 44 / 44 / 44
83 full revision size (min/max/avg) : 44 / 44 / 44
84 inter-snapshot size (min/max/avg) : 0 / 0 / 0
84 inter-snapshot size (min/max/avg) : 0 / 0 / 0
85 delta size (min/max/avg) : 0 / 0 / 0
85 delta size (min/max/avg) : 0 / 0 / 0
86 $ hg debugrevlog a
86 $ hg debugrevlog a
87 format : 1
87 format : 1
88 flags : inline, generaldelta
88 flags : inline, generaldelta
89
89
90 revisions : 1
90 revisions : 1
91 merges : 0 ( 0.00%)
91 merges : 0 ( 0.00%)
92 normal : 1 (100.00%)
92 normal : 1 (100.00%)
93 revisions : 1
93 revisions : 1
94 empty : 0 ( 0.00%)
94 empty : 0 ( 0.00%)
95 text : 0 (100.00%)
95 text : 0 (100.00%)
96 delta : 0 (100.00%)
96 delta : 0 (100.00%)
97 snapshot : 1 (100.00%)
97 snapshot : 1 (100.00%)
98 lvl-0 : 1 (100.00%)
98 lvl-0 : 1 (100.00%)
99 deltas : 0 ( 0.00%)
99 deltas : 0 ( 0.00%)
100 revision size : 3
100 revision size : 3
101 snapshot : 3 (100.00%)
101 snapshot : 3 (100.00%)
102 lvl-0 : 3 (100.00%)
102 lvl-0 : 3 (100.00%)
103 deltas : 0 ( 0.00%)
103 deltas : 0 ( 0.00%)
104
104
105 chunks : 1
105 chunks : 1
106 0x75 (u) : 1 (100.00%)
106 0x75 (u) : 1 (100.00%)
107 chunks size : 3
107 chunks size : 3
108 0x75 (u) : 3 (100.00%)
108 0x75 (u) : 3 (100.00%)
109
109
110 avg chain length : 0
110 avg chain length : 0
111 max chain length : 0
111 max chain length : 0
112 max chain reach : 3
112 max chain reach : 3
113 compression ratio : 0
113 compression ratio : 0
114
114
115 uncompressed data size (min/max/avg) : 2 / 2 / 2
115 uncompressed data size (min/max/avg) : 2 / 2 / 2
116 full revision size (min/max/avg) : 3 / 3 / 3
116 full revision size (min/max/avg) : 3 / 3 / 3
117 inter-snapshot size (min/max/avg) : 0 / 0 / 0
117 inter-snapshot size (min/max/avg) : 0 / 0 / 0
118 delta size (min/max/avg) : 0 / 0 / 0
118 delta size (min/max/avg) : 0 / 0 / 0
119 #endif
119 #endif
120
120
121 Test debugindex, with and without the --verbose/--debug flag
121 Test debugindex, with and without the --verbose/--debug flag
122 $ hg debugrevlogindex a
122 $ hg debugrevlogindex a
123 rev linkrev nodeid p1 p2
123 rev linkrev nodeid p1 p2
124 0 0 b789fdd96dc2 000000000000 000000000000
124 0 0 b789fdd96dc2 000000000000 000000000000
125
125
126 #if no-reposimplestore
126 #if no-reposimplestore
127 $ hg --verbose debugrevlogindex a
127 $ hg --verbose debugrevlogindex a
128 rev offset length linkrev nodeid p1 p2
128 rev offset length linkrev nodeid p1 p2
129 0 0 3 0 b789fdd96dc2 000000000000 000000000000
129 0 0 3 0 b789fdd96dc2 000000000000 000000000000
130
130
131 $ hg --debug debugrevlogindex a
131 $ hg --debug debugrevlogindex a
132 rev offset length linkrev nodeid p1 p2
132 rev offset length linkrev nodeid p1 p2
133 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
133 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
134 #endif
134 #endif
135
135
136 $ hg debugrevlogindex -f 1 a
136 $ hg debugrevlogindex -f 1 a
137 rev flag size link p1 p2 nodeid
137 rev flag size link p1 p2 nodeid
138 0 0000 2 0 -1 -1 b789fdd96dc2
138 0 0000 2 0 -1 -1 b789fdd96dc2
139
139
140 #if no-reposimplestore
140 #if no-reposimplestore
141 $ hg --verbose debugrevlogindex -f 1 a
141 $ hg --verbose debugrevlogindex -f 1 a
142 rev flag offset length size link p1 p2 nodeid
142 rev flag offset length size link p1 p2 nodeid
143 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
143 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
144
144
145 $ hg --debug debugrevlogindex -f 1 a
145 $ hg --debug debugrevlogindex -f 1 a
146 rev flag offset length size link p1 p2 nodeid
146 rev flag offset length size link p1 p2 nodeid
147 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
147 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
148 #endif
148 #endif
149
149
150 $ hg debugindex -c
150 $ hg debugindex -c
151 rev linkrev nodeid p1 p2
151 rev linkrev nodeid p1 p2
152 0 0 07f494440405 000000000000 000000000000
152 0 0 07f494440405 000000000000 000000000000
153 1 1 8cccb4b5fec2 07f494440405 000000000000
153 1 1 8cccb4b5fec2 07f494440405 000000000000
154 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
154 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
155 $ hg debugindex -c --debug
155 $ hg debugindex -c --debug
156 rev linkrev nodeid p1 p2
156 rev linkrev nodeid p1 p2
157 0 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
157 0 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
158 1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000
158 1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000
159 2 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0000000000000000000000000000000000000000
159 2 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0000000000000000000000000000000000000000
160 $ hg debugindex -m
160 $ hg debugindex -m
161 rev linkrev nodeid p1 p2
161 rev linkrev nodeid p1 p2
162 0 0 a0c8bcbbb45c 000000000000 000000000000
162 0 0 a0c8bcbbb45c 000000000000 000000000000
163 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
163 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
164 2 2 a35b10320954 57faf8a737ae 000000000000
164 2 2 a35b10320954 57faf8a737ae 000000000000
165 $ hg debugindex -m --debug
165 $ hg debugindex -m --debug
166 rev linkrev nodeid p1 p2
166 rev linkrev nodeid p1 p2
167 0 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
167 0 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
168 1 1 57faf8a737ae7faf490582941a82319ba6529dca a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000
168 1 1 57faf8a737ae7faf490582941a82319ba6529dca a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000
169 2 2 a35b103209548032201c16c7688cb2657f037a38 57faf8a737ae7faf490582941a82319ba6529dca 0000000000000000000000000000000000000000
169 2 2 a35b103209548032201c16c7688cb2657f037a38 57faf8a737ae7faf490582941a82319ba6529dca 0000000000000000000000000000000000000000
170 $ hg debugindex a
170 $ hg debugindex a
171 rev linkrev nodeid p1 p2
171 rev linkrev nodeid p1 p2
172 0 0 b789fdd96dc2 000000000000 000000000000
172 0 0 b789fdd96dc2 000000000000 000000000000
173 $ hg debugindex --debug a
173 $ hg debugindex --debug a
174 rev linkrev nodeid p1 p2
174 rev linkrev nodeid p1 p2
175 0 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
175 0 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
176
176
177 debugdelta chain basic output
177 debugdelta chain basic output
178
178
179 #if reporevlogstore pure
179 #if reporevlogstore pure
180 $ hg debugindexstats
180 $ hg debugindexstats
181 abort: debugindexstats only works with native code
181 abort: debugindexstats only works with native code
182 [255]
182 [255]
183 #endif
183 #endif
184 #if reporevlogstore no-pure
184 #if reporevlogstore no-pure
185 $ hg debugindexstats
185 $ hg debugindexstats
186 node trie capacity: 4
186 node trie capacity: 4
187 node trie count: 2
187 node trie count: 2
188 node trie depth: 1
188 node trie depth: 1
189 node trie last rev scanned: -1
189 node trie last rev scanned: -1
190 node trie lookups: 4
190 node trie lookups: 4
191 node trie misses: 1
191 node trie misses: 1
192 node trie splits: 1
192 node trie splits: 1
193 revs in memory: 3
193 revs in memory: 3
194 #endif
194 #endif
195
195
196 #if reporevlogstore no-pure
196 #if reporevlogstore no-pure
197 $ hg debugdeltachain -m
197 $ hg debugdeltachain -m
198 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
198 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
199 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
199 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
200 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
200 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
201 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
201 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
202
202
203 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
203 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
204 0 1 1
204 0 1 1
205 1 2 1
205 1 2 1
206 2 3 1
206 2 3 1
207
207
208 $ hg debugdeltachain -m -Tjson
208 $ hg debugdeltachain -m -Tjson
209 [
209 [
210 {
210 {
211 "chainid": 1,
211 "chainid": 1,
212 "chainlen": 1,
212 "chainlen": 1,
213 "chainratio": 1.02325581395, (no-py3 !)
213 "chainratio": 1.02325581395, (no-py3 !)
214 "chainratio": 1.0232558139534884, (py3 !)
214 "chainratio": 1.0232558139534884, (py3 !)
215 "chainsize": 44,
215 "chainsize": 44,
216 "compsize": 44,
216 "compsize": 44,
217 "deltatype": "base",
217 "deltatype": "base",
218 "extradist": 0,
218 "extradist": 0,
219 "extraratio": 0.0,
219 "extraratio": 0.0,
220 "largestblock": 44,
220 "largestblock": 44,
221 "lindist": 44,
221 "lindist": 44,
222 "prevrev": -1,
222 "prevrev": -1,
223 "readdensity": 1.0,
223 "readdensity": 1.0,
224 "readsize": 44,
224 "readsize": 44,
225 "rev": 0,
225 "rev": 0,
226 "srchunks": 1,
226 "srchunks": 1,
227 "uncompsize": 43
227 "uncompsize": 43
228 },
228 },
229 {
229 {
230 "chainid": 2,
230 "chainid": 2,
231 "chainlen": 1,
231 "chainlen": 1,
232 "chainratio": 0,
232 "chainratio": 0,
233 "chainsize": 0,
233 "chainsize": 0,
234 "compsize": 0,
234 "compsize": 0,
235 "deltatype": "base",
235 "deltatype": "base",
236 "extradist": 0,
236 "extradist": 0,
237 "extraratio": 0,
237 "extraratio": 0,
238 "largestblock": 0,
238 "largestblock": 0,
239 "lindist": 0,
239 "lindist": 0,
240 "prevrev": -1,
240 "prevrev": -1,
241 "readdensity": 1,
241 "readdensity": 1,
242 "readsize": 0,
242 "readsize": 0,
243 "rev": 1,
243 "rev": 1,
244 "srchunks": 1,
244 "srchunks": 1,
245 "uncompsize": 0
245 "uncompsize": 0
246 },
246 },
247 {
247 {
248 "chainid": 3,
248 "chainid": 3,
249 "chainlen": 1,
249 "chainlen": 1,
250 "chainratio": 1.02325581395, (no-py3 !)
250 "chainratio": 1.02325581395, (no-py3 !)
251 "chainratio": 1.0232558139534884, (py3 !)
251 "chainratio": 1.0232558139534884, (py3 !)
252 "chainsize": 44,
252 "chainsize": 44,
253 "compsize": 44,
253 "compsize": 44,
254 "deltatype": "base",
254 "deltatype": "base",
255 "extradist": 0,
255 "extradist": 0,
256 "extraratio": 0.0,
256 "extraratio": 0.0,
257 "largestblock": 44,
257 "largestblock": 44,
258 "lindist": 44,
258 "lindist": 44,
259 "prevrev": -1,
259 "prevrev": -1,
260 "readdensity": 1.0,
260 "readdensity": 1.0,
261 "readsize": 44,
261 "readsize": 44,
262 "rev": 2,
262 "rev": 2,
263 "srchunks": 1,
263 "srchunks": 1,
264 "uncompsize": 43
264 "uncompsize": 43
265 }
265 }
266 ]
266 ]
267
267
268 debugdelta chain with sparse read enabled
268 debugdelta chain with sparse read enabled
269
269
270 $ cat >> $HGRCPATH <<EOF
270 $ cat >> $HGRCPATH <<EOF
271 > [experimental]
271 > [experimental]
272 > sparse-read = True
272 > sparse-read = True
273 > EOF
273 > EOF
274 $ hg debugdeltachain -m
274 $ hg debugdeltachain -m
275 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
275 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
276 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
276 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
277 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
277 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
278 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
278 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
279
279
280 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
280 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
281 0 1 1 44 44 1.0
281 0 1 1 44 44 1.0
282 1 2 1 0 0 1
282 1 2 1 0 0 1
283 2 3 1 44 44 1.0
283 2 3 1 44 44 1.0
284
284
285 $ hg debugdeltachain -m -Tjson
285 $ hg debugdeltachain -m -Tjson
286 [
286 [
287 {
287 {
288 "chainid": 1,
288 "chainid": 1,
289 "chainlen": 1,
289 "chainlen": 1,
290 "chainratio": 1.02325581395, (no-py3 !)
290 "chainratio": 1.02325581395, (no-py3 !)
291 "chainratio": 1.0232558139534884, (py3 !)
291 "chainratio": 1.0232558139534884, (py3 !)
292 "chainsize": 44,
292 "chainsize": 44,
293 "compsize": 44,
293 "compsize": 44,
294 "deltatype": "base",
294 "deltatype": "base",
295 "extradist": 0,
295 "extradist": 0,
296 "extraratio": 0.0,
296 "extraratio": 0.0,
297 "largestblock": 44,
297 "largestblock": 44,
298 "lindist": 44,
298 "lindist": 44,
299 "prevrev": -1,
299 "prevrev": -1,
300 "readdensity": 1.0,
300 "readdensity": 1.0,
301 "readsize": 44,
301 "readsize": 44,
302 "rev": 0,
302 "rev": 0,
303 "srchunks": 1,
303 "srchunks": 1,
304 "uncompsize": 43
304 "uncompsize": 43
305 },
305 },
306 {
306 {
307 "chainid": 2,
307 "chainid": 2,
308 "chainlen": 1,
308 "chainlen": 1,
309 "chainratio": 0,
309 "chainratio": 0,
310 "chainsize": 0,
310 "chainsize": 0,
311 "compsize": 0,
311 "compsize": 0,
312 "deltatype": "base",
312 "deltatype": "base",
313 "extradist": 0,
313 "extradist": 0,
314 "extraratio": 0,
314 "extraratio": 0,
315 "largestblock": 0,
315 "largestblock": 0,
316 "lindist": 0,
316 "lindist": 0,
317 "prevrev": -1,
317 "prevrev": -1,
318 "readdensity": 1,
318 "readdensity": 1,
319 "readsize": 0,
319 "readsize": 0,
320 "rev": 1,
320 "rev": 1,
321 "srchunks": 1,
321 "srchunks": 1,
322 "uncompsize": 0
322 "uncompsize": 0
323 },
323 },
324 {
324 {
325 "chainid": 3,
325 "chainid": 3,
326 "chainlen": 1,
326 "chainlen": 1,
327 "chainratio": 1.02325581395, (no-py3 !)
327 "chainratio": 1.02325581395, (no-py3 !)
328 "chainratio": 1.0232558139534884, (py3 !)
328 "chainratio": 1.0232558139534884, (py3 !)
329 "chainsize": 44,
329 "chainsize": 44,
330 "compsize": 44,
330 "compsize": 44,
331 "deltatype": "base",
331 "deltatype": "base",
332 "extradist": 0,
332 "extradist": 0,
333 "extraratio": 0.0,
333 "extraratio": 0.0,
334 "largestblock": 44,
334 "largestblock": 44,
335 "lindist": 44,
335 "lindist": 44,
336 "prevrev": -1,
336 "prevrev": -1,
337 "readdensity": 1.0,
337 "readdensity": 1.0,
338 "readsize": 44,
338 "readsize": 44,
339 "rev": 2,
339 "rev": 2,
340 "srchunks": 1,
340 "srchunks": 1,
341 "uncompsize": 43
341 "uncompsize": 43
342 }
342 }
343 ]
343 ]
344
344
345 $ printf "This test checks things.\n" >> a
345 $ printf "This test checks things.\n" >> a
346 $ hg ci -m a
346 $ hg ci -m a
347 $ hg branch other
347 $ hg branch other
348 marked working directory as branch other
348 marked working directory as branch other
349 (branches are permanent and global, did you want a bookmark?)
349 (branches are permanent and global, did you want a bookmark?)
350 $ for i in `$TESTDIR/seq.py 5`; do
350 $ for i in `$TESTDIR/seq.py 5`; do
351 > printf "shorter ${i}" >> a
351 > printf "shorter ${i}" >> a
352 > hg ci -m "a other:$i"
352 > hg ci -m "a other:$i"
353 > hg up -q default
353 > hg up -q default
354 > printf "for the branch default we want longer chains: ${i}" >> a
354 > printf "for the branch default we want longer chains: ${i}" >> a
355 > hg ci -m "a default:$i"
355 > hg ci -m "a default:$i"
356 > hg up -q other
356 > hg up -q other
357 > done
357 > done
358 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
358 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
359 > --config experimental.sparse-read.density-threshold=0.50 \
359 > --config experimental.sparse-read.density-threshold=0.50 \
360 > --config experimental.sparse-read.min-gap-size=0
360 > --config experimental.sparse-read.min-gap-size=0
361 0 1
361 0 1
362 1 1
362 1 1
363 2 1
363 2 1
364 3 1
364 3 1
365 4 1
365 4 1
366 5 1
366 5 1
367 6 1
367 6 1
368 7 1
368 7 1
369 8 1
369 8 1
370 9 1
370 9 1
371 10 2
371 10 2
372 11 1
372 11 1
373 $ hg --config extensions.strip= strip --no-backup -r 1
373 $ hg --config extensions.strip= strip --no-backup -r 1
374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
375
375
376 Test max chain len
376 Test max chain len
377 $ cat >> $HGRCPATH << EOF
377 $ cat >> $HGRCPATH << EOF
378 > [format]
378 > [format]
379 > maxchainlen=4
379 > maxchainlen=4
380 > EOF
380 > EOF
381
381
382 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
382 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
383 $ hg ci -m a
383 $ hg ci -m a
384 $ printf "b\n" >> a
384 $ printf "b\n" >> a
385 $ hg ci -m a
385 $ hg ci -m a
386 $ printf "c\n" >> a
386 $ printf "c\n" >> a
387 $ hg ci -m a
387 $ hg ci -m a
388 $ printf "d\n" >> a
388 $ printf "d\n" >> a
389 $ hg ci -m a
389 $ hg ci -m a
390 $ printf "e\n" >> a
390 $ printf "e\n" >> a
391 $ hg ci -m a
391 $ hg ci -m a
392 $ printf "f\n" >> a
392 $ printf "f\n" >> a
393 $ hg ci -m a
393 $ hg ci -m a
394 $ printf 'g\n' >> a
394 $ printf 'g\n' >> a
395 $ hg ci -m a
395 $ hg ci -m a
396 $ printf 'h\n' >> a
396 $ printf 'h\n' >> a
397 $ hg ci -m a
397 $ hg ci -m a
398
398
399 $ hg debugrevlog -d a
399 $ hg debugrevlog -d a
400 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
400 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
401 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
401 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
402 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
402 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
403 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
403 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
404 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
404 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
405 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
405 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
406 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
406 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
407 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
407 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
408 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
408 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
409 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
409 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
410 #endif
410 #endif
411
411
412 Test debuglocks command:
412 Test debuglocks command:
413
413
414 $ hg debuglocks
414 $ hg debuglocks
415 lock: free
415 lock: free
416 wlock: free
416 wlock: free
417
417
418 * Test setting the lock
418 * Test setting the lock
419
419
420 waitlock <file> will wait for file to be created. If it isn't in a reasonable
420 waitlock <file> will wait for file to be created. If it isn't in a reasonable
421 amount of time, displays error message and returns 1
421 amount of time, displays error message and returns 1
422 $ waitlock() {
422 $ waitlock() {
423 > start=`date +%s`
423 > start=`date +%s`
424 > timeout=5
424 > timeout=5
425 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
425 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
426 > now=`date +%s`
426 > now=`date +%s`
427 > if [ "`expr $now - $start`" -gt $timeout ]; then
427 > if [ "`expr $now - $start`" -gt $timeout ]; then
428 > echo "timeout: $1 was not created in $timeout seconds"
428 > echo "timeout: $1 was not created in $timeout seconds"
429 > return 1
429 > return 1
430 > fi
430 > fi
431 > sleep 0.1
431 > sleep 0.1
432 > done
432 > done
433 > }
433 > }
434 $ dolock() {
434 $ dolock() {
435 > {
435 > {
436 > waitlock .hg/unlock
436 > waitlock .hg/unlock
437 > rm -f .hg/unlock
437 > rm -f .hg/unlock
438 > echo y
438 > echo y
439 > } | hg debuglocks "$@" > /dev/null
439 > } | hg debuglocks "$@" > /dev/null
440 > }
440 > }
441 $ dolock -s &
441 $ dolock -s &
442 $ waitlock .hg/store/lock
442 $ waitlock .hg/store/lock
443
443
444 $ hg debuglocks
444 $ hg debuglocks
445 lock: user *, process * (*s) (glob)
445 lock: user *, process * (*s) (glob)
446 wlock: free
446 wlock: free
447 [1]
447 [1]
448 $ touch .hg/unlock
448 $ touch .hg/unlock
449 $ wait
449 $ wait
450 $ [ -f .hg/store/lock ] || echo "There is no lock"
450 $ [ -f .hg/store/lock ] || echo "There is no lock"
451 There is no lock
451 There is no lock
452
452
453 * Test setting the wlock
453 * Test setting the wlock
454
454
455 $ dolock -S &
455 $ dolock -S &
456 $ waitlock .hg/wlock
456 $ waitlock .hg/wlock
457
457
458 $ hg debuglocks
458 $ hg debuglocks
459 lock: free
459 lock: free
460 wlock: user *, process * (*s) (glob)
460 wlock: user *, process * (*s) (glob)
461 [1]
461 [1]
462 $ touch .hg/unlock
462 $ touch .hg/unlock
463 $ wait
463 $ wait
464 $ [ -f .hg/wlock ] || echo "There is no wlock"
464 $ [ -f .hg/wlock ] || echo "There is no wlock"
465 There is no wlock
465 There is no wlock
466
466
467 * Test setting both locks
467 * Test setting both locks
468
468
469 $ dolock -Ss &
469 $ dolock -Ss &
470 $ waitlock .hg/wlock && waitlock .hg/store/lock
470 $ waitlock .hg/wlock && waitlock .hg/store/lock
471
471
472 $ hg debuglocks
472 $ hg debuglocks
473 lock: user *, process * (*s) (glob)
473 lock: user *, process * (*s) (glob)
474 wlock: user *, process * (*s) (glob)
474 wlock: user *, process * (*s) (glob)
475 [2]
475 [2]
476
476
477 * Test failing to set a lock
477 * Test failing to set a lock
478
478
479 $ hg debuglocks -s
479 $ hg debuglocks -s
480 abort: lock is already held
480 abort: lock is already held
481 [255]
481 [255]
482
482
483 $ hg debuglocks -S
483 $ hg debuglocks -S
484 abort: wlock is already held
484 abort: wlock is already held
485 [255]
485 [255]
486
486
487 $ touch .hg/unlock
487 $ touch .hg/unlock
488 $ wait
488 $ wait
489
489
490 $ hg debuglocks
490 $ hg debuglocks
491 lock: free
491 lock: free
492 wlock: free
492 wlock: free
493
493
494 * Test forcing the lock
494 * Test forcing the lock
495
495
496 $ dolock -s &
496 $ dolock -s &
497 $ waitlock .hg/store/lock
497 $ waitlock .hg/store/lock
498
498
499 $ hg debuglocks
499 $ hg debuglocks
500 lock: user *, process * (*s) (glob)
500 lock: user *, process * (*s) (glob)
501 wlock: free
501 wlock: free
502 [1]
502 [1]
503
503
504 $ hg debuglocks -L
504 $ hg debuglocks -L
505
505
506 $ hg debuglocks
506 $ hg debuglocks
507 lock: free
507 lock: free
508 wlock: free
508 wlock: free
509
509
510 $ touch .hg/unlock
510 $ touch .hg/unlock
511 $ wait
511 $ wait
512
512
513 * Test forcing the wlock
513 * Test forcing the wlock
514
514
515 $ dolock -S &
515 $ dolock -S &
516 $ waitlock .hg/wlock
516 $ waitlock .hg/wlock
517
517
518 $ hg debuglocks
518 $ hg debuglocks
519 lock: free
519 lock: free
520 wlock: user *, process * (*s) (glob)
520 wlock: user *, process * (*s) (glob)
521 [1]
521 [1]
522
522
523 $ hg debuglocks -W
523 $ hg debuglocks -W
524
524
525 $ hg debuglocks
525 $ hg debuglocks
526 lock: free
526 lock: free
527 wlock: free
527 wlock: free
528
528
529 $ touch .hg/unlock
529 $ touch .hg/unlock
530 $ wait
530 $ wait
531
531
532 Test WdirUnsupported exception
532 Test WdirUnsupported exception
533
533
534 #if no-rhg
534 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
535 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
535 abort: working directory revision cannot be specified
536 abort: working directory revision cannot be specified
536 [255]
537 [255]
538 #else
539 TODO: add rhg support for (at least parsing) the working directory pseudo-changeset
540 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
541 abort: working directory revision cannot be specified (missing-correct-output !)
542 abort: invalid revision identifier: ffffffffffffffffffffffffffffffffffffffff (known-bad-output !)
543 [255]
544 #endif
537
545
538 Test cache warming command
546 Test cache warming command
539
547
540 $ rm -rf .hg/cache/
548 $ rm -rf .hg/cache/
541 $ hg debugupdatecaches --debug
549 $ hg debugupdatecaches --debug
542 updating the branch cache
550 updating the branch cache
543 $ ls -r .hg/cache/*
551 $ ls -r .hg/cache/*
544 .hg/cache/tags2-served
552 .hg/cache/tags2-served
545 .hg/cache/tags2
553 .hg/cache/tags2
546 .hg/cache/rbc-revs-v1
554 .hg/cache/rbc-revs-v1
547 .hg/cache/rbc-names-v1
555 .hg/cache/rbc-names-v1
548 .hg/cache/hgtagsfnodes1
556 .hg/cache/hgtagsfnodes1
549 .hg/cache/branch2-visible-hidden
557 .hg/cache/branch2-visible-hidden
550 .hg/cache/branch2-visible
558 .hg/cache/branch2-visible
551 .hg/cache/branch2-served.hidden
559 .hg/cache/branch2-served.hidden
552 .hg/cache/branch2-served
560 .hg/cache/branch2-served
553 .hg/cache/branch2-immutable
561 .hg/cache/branch2-immutable
554 .hg/cache/branch2-base
562 .hg/cache/branch2-base
555
563
556 Test debugcolor
564 Test debugcolor
557
565
558 #if no-windows
566 #if no-windows
559 $ hg debugcolor --style --color always | egrep 'mode|style|log\.'
567 $ hg debugcolor --style --color always | egrep 'mode|style|log\.'
560 color mode: 'ansi'
568 color mode: 'ansi'
561 available style:
569 available style:
562 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
570 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
563 #endif
571 #endif
564
572
565 $ hg debugcolor --style --color never
573 $ hg debugcolor --style --color never
566 color mode: None
574 color mode: None
567 available style:
575 available style:
568
576
569 $ cd ..
577 $ cd ..
570
578
571 Test internal debugstacktrace command
579 Test internal debugstacktrace command
572
580
573 $ cat > debugstacktrace.py << EOF
581 $ cat > debugstacktrace.py << EOF
574 > from __future__ import absolute_import
582 > from __future__ import absolute_import
575 > from mercurial import (
583 > from mercurial import (
576 > util,
584 > util,
577 > )
585 > )
578 > from mercurial.utils import (
586 > from mercurial.utils import (
579 > procutil,
587 > procutil,
580 > )
588 > )
581 > def f():
589 > def f():
582 > util.debugstacktrace(f=procutil.stdout)
590 > util.debugstacktrace(f=procutil.stdout)
583 > g()
591 > g()
584 > def g():
592 > def g():
585 > util.dst(b'hello from g\\n', skip=1)
593 > util.dst(b'hello from g\\n', skip=1)
586 > h()
594 > h()
587 > def h():
595 > def h():
588 > util.dst(b'hi ...\\nfrom h hidden in g', 1, depth=2)
596 > util.dst(b'hi ...\\nfrom h hidden in g', 1, depth=2)
589 > f()
597 > f()
590 > EOF
598 > EOF
591 $ "$PYTHON" debugstacktrace.py
599 $ "$PYTHON" debugstacktrace.py
592 stacktrace at:
600 stacktrace at:
593 *debugstacktrace.py:16 in * (glob)
601 *debugstacktrace.py:16 in * (glob)
594 *debugstacktrace.py:9 in f (glob)
602 *debugstacktrace.py:9 in f (glob)
595 hello from g at:
603 hello from g at:
596 *debugstacktrace.py:16 in * (glob)
604 *debugstacktrace.py:16 in * (glob)
597 *debugstacktrace.py:10 in f (glob)
605 *debugstacktrace.py:10 in f (glob)
598 hi ...
606 hi ...
599 from h hidden in g at:
607 from h hidden in g at:
600 *debugstacktrace.py:10 in f (glob)
608 *debugstacktrace.py:10 in f (glob)
601 *debugstacktrace.py:13 in g (glob)
609 *debugstacktrace.py:13 in g (glob)
602
610
603 Test debugcapabilities command:
611 Test debugcapabilities command:
604
612
605 $ hg debugcapabilities ./debugrevlog/
613 $ hg debugcapabilities ./debugrevlog/
606 Main capabilities:
614 Main capabilities:
607 branchmap
615 branchmap
608 $USUAL_BUNDLE2_CAPS$
616 $USUAL_BUNDLE2_CAPS$
609 getbundle
617 getbundle
610 known
618 known
611 lookup
619 lookup
612 pushkey
620 pushkey
613 unbundle
621 unbundle
614 Bundle2 capabilities:
622 Bundle2 capabilities:
615 HG20
623 HG20
616 bookmarks
624 bookmarks
617 changegroup
625 changegroup
618 01
626 01
619 02
627 02
620 checkheads
628 checkheads
621 related
629 related
622 digests
630 digests
623 md5
631 md5
624 sha1
632 sha1
625 sha512
633 sha512
626 error
634 error
627 abort
635 abort
628 unsupportedcontent
636 unsupportedcontent
629 pushraced
637 pushraced
630 pushkey
638 pushkey
631 hgtagsfnodes
639 hgtagsfnodes
632 listkeys
640 listkeys
633 phases
641 phases
634 heads
642 heads
635 pushkey
643 pushkey
636 remote-changegroup
644 remote-changegroup
637 http
645 http
638 https
646 https
639 stream
647 stream
640 v2
648 v2
641
649
642 Test debugpeer
650 Test debugpeer
643
651
644 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" debugpeer ssh://user@dummy/debugrevlog
652 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" debugpeer ssh://user@dummy/debugrevlog
645 url: ssh://user@dummy/debugrevlog
653 url: ssh://user@dummy/debugrevlog
646 local: no
654 local: no
647 pushable: yes
655 pushable: yes
648
656
649 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" --debug debugpeer ssh://user@dummy/debugrevlog
657 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" --debug debugpeer ssh://user@dummy/debugrevlog
650 running "*" "*/tests/dummyssh" 'user@dummy' 'hg -R debugrevlog serve --stdio' (glob) (no-windows !)
658 running "*" "*/tests/dummyssh" 'user@dummy' 'hg -R debugrevlog serve --stdio' (glob) (no-windows !)
651 running "*" "*\tests/dummyssh" "user@dummy" "hg -R debugrevlog serve --stdio" (glob) (windows !)
659 running "*" "*\tests/dummyssh" "user@dummy" "hg -R debugrevlog serve --stdio" (glob) (windows !)
652 devel-peer-request: hello+between
660 devel-peer-request: hello+between
653 devel-peer-request: pairs: 81 bytes
661 devel-peer-request: pairs: 81 bytes
654 sending hello command
662 sending hello command
655 sending between command
663 sending between command
656 remote: 444
664 remote: 444
657 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
665 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
658 remote: 1
666 remote: 1
659 devel-peer-request: protocaps
667 devel-peer-request: protocaps
660 devel-peer-request: caps: * bytes (glob)
668 devel-peer-request: caps: * bytes (glob)
661 sending protocaps command
669 sending protocaps command
662 url: ssh://user@dummy/debugrevlog
670 url: ssh://user@dummy/debugrevlog
663 local: no
671 local: no
664 pushable: yes
672 pushable: yes
@@ -1,221 +1,224 b''
1 test command parsing and dispatch
1 test command parsing and dispatch
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5
5
6 Redundant options used to crash (issue436):
6 Redundant options used to crash (issue436):
7 $ hg -v log -v
7 $ hg -v log -v
8 $ hg -v log -v x
8 $ hg -v log -v x
9
9
10 $ echo a > a
10 $ echo a > a
11 $ hg ci -Ama
11 $ hg ci -Ama
12 adding a
12 adding a
13
13
14 Missing arg:
14 Missing arg:
15
15
16 $ hg cat
16 $ hg cat
17 hg cat: invalid arguments
17 hg cat: invalid arguments
18 hg cat [OPTION]... FILE...
18 hg cat [OPTION]... FILE...
19
19
20 output the current or given revision of files
20 output the current or given revision of files
21
21
22 options ([+] can be repeated):
22 options ([+] can be repeated):
23
23
24 -o --output FORMAT print output to file with formatted name
24 -o --output FORMAT print output to file with formatted name
25 -r --rev REV print the given revision
25 -r --rev REV print the given revision
26 --decode apply any matching decode filter
26 --decode apply any matching decode filter
27 -I --include PATTERN [+] include names matching the given patterns
27 -I --include PATTERN [+] include names matching the given patterns
28 -X --exclude PATTERN [+] exclude names matching the given patterns
28 -X --exclude PATTERN [+] exclude names matching the given patterns
29 -T --template TEMPLATE display with template
29 -T --template TEMPLATE display with template
30
30
31 (use 'hg cat -h' to show more help)
31 (use 'hg cat -h' to show more help)
32 [10]
32 [10]
33
33
34 Missing parameter for early option:
34 Missing parameter for early option:
35
35
36 $ hg log -R 2>&1 | grep 'hg log'
36 $ hg log -R 2>&1 | grep 'hg log'
37 hg log: option -R requires argument
37 hg log: option -R requires argument
38 hg log [OPTION]... [FILE]
38 hg log [OPTION]... [FILE]
39 (use 'hg log -h' to show more help)
39 (use 'hg log -h' to show more help)
40
40
41 "--" may be an option value:
41 "--" may be an option value:
42
42
43 $ hg -R -- log
43 $ hg -R -- log
44 abort: repository -- not found
44 abort: repository -- not found
45 [255]
45 [255]
46 $ hg log -R --
46 $ hg log -R --
47 abort: repository -- not found
47 abort: repository -- not found
48 [255]
48 [255]
49 $ hg log -T --
49 $ hg log -T --
50 -- (no-eol)
50 -- (no-eol)
51 $ hg log -T -- -k nomatch
51 $ hg log -T -- -k nomatch
52
52
53 Parsing of early options should stop at "--":
53 Parsing of early options should stop at "--":
54
54
55 $ hg cat -- --config=hooks.pre-cat=false
55 $ hg cat -- --config=hooks.pre-cat=false
56 --config=hooks.pre-cat=false: no such file in rev cb9a9f314b8b
56 --config=hooks.pre-cat=false: no such file in rev cb9a9f314b8b
57 [1]
57 [1]
58 $ hg cat -- --debugger
58 $ hg cat -- --debugger
59 --debugger: no such file in rev cb9a9f314b8b
59 --debugger: no such file in rev cb9a9f314b8b
60 [1]
60 [1]
61
61
62 Unparsable form of early options:
62 Unparsable form of early options:
63
63
64 $ hg cat --debugg
64 $ hg cat --debugg
65 abort: option --debugger may not be abbreviated
65 abort: option --debugger may not be abbreviated
66 [10]
66 [10]
67
67
68 Parsing failure of early options should be detected before executing the
68 Parsing failure of early options should be detected before executing the
69 command:
69 command:
70
70
71 $ hg log -b '--config=hooks.pre-log=false' default
71 $ hg log -b '--config=hooks.pre-log=false' default
72 abort: option --config may not be abbreviated
72 abort: option --config may not be abbreviated
73 [10]
73 [10]
74 $ hg log -b -R. default
74 $ hg log -b -R. default
75 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
75 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
76 [10]
76 [10]
77 $ hg log --cwd .. -b --cwd=. default
77 $ hg log --cwd .. -b --cwd=. default
78 abort: option --cwd may not be abbreviated
78 abort: option --cwd may not be abbreviated
79 [10]
79 [10]
80
80
81 However, we can't prevent it from loading extensions and configs:
81 However, we can't prevent it from loading extensions and configs:
82
82
83 $ cat <<EOF > bad.py
83 $ cat <<EOF > bad.py
84 > raise Exception('bad')
84 > raise Exception('bad')
85 > EOF
85 > EOF
86 $ hg log -b '--config=extensions.bad=bad.py' default
86 $ hg log -b '--config=extensions.bad=bad.py' default
87 *** failed to import extension bad from bad.py: bad
87 *** failed to import extension bad from bad.py: bad
88 abort: option --config may not be abbreviated
88 abort: option --config may not be abbreviated
89 [10]
89 [10]
90
90
91 $ mkdir -p badrepo/.hg
91 $ mkdir -p badrepo/.hg
92 $ echo 'invalid-syntax' > badrepo/.hg/hgrc
92 $ echo 'invalid-syntax' > badrepo/.hg/hgrc
93 TODO: add rhg support for detailed exit codes
94 #if no-rhg
93 $ hg log -b -Rbadrepo default
95 $ hg log -b -Rbadrepo default
94 config error at badrepo/.hg/hgrc:1: invalid-syntax
96 config error at badrepo/.hg/hgrc:1: invalid-syntax
95 [30]
97 [30]
98 #endif
96
99
97 $ hg log -b --cwd=inexistent default
100 $ hg log -b --cwd=inexistent default
98 abort: $ENOENT$: 'inexistent'
101 abort: $ENOENT$: 'inexistent'
99 [255]
102 [255]
100
103
101 $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback'
104 $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback'
102 Traceback (most recent call last):
105 Traceback (most recent call last):
103 $ hg log -b '--config=profiling.enabled=yes' 2>&1 | grep -i sample
106 $ hg log -b '--config=profiling.enabled=yes' 2>&1 | grep -i sample
104 Sample count: .*|No samples recorded\. (re)
107 Sample count: .*|No samples recorded\. (re)
105
108
106 Early options can't be specified in [aliases] and [defaults] because they are
109 Early options can't be specified in [aliases] and [defaults] because they are
107 applied before the command name is resolved:
110 applied before the command name is resolved:
108
111
109 $ hg log -b '--config=alias.log=log --config=hooks.pre-log=false'
112 $ hg log -b '--config=alias.log=log --config=hooks.pre-log=false'
110 hg log: option -b not recognized
113 hg log: option -b not recognized
111 error in definition for alias 'log': --config may only be given on the command
114 error in definition for alias 'log': --config may only be given on the command
112 line
115 line
113 [10]
116 [10]
114
117
115 $ hg log -b '--config=defaults.log=--config=hooks.pre-log=false'
118 $ hg log -b '--config=defaults.log=--config=hooks.pre-log=false'
116 abort: option --config may not be abbreviated
119 abort: option --config may not be abbreviated
117 [10]
120 [10]
118
121
119 Shell aliases bypass any command parsing rules but for the early one:
122 Shell aliases bypass any command parsing rules but for the early one:
120
123
121 $ hg log -b '--config=alias.log=!echo howdy'
124 $ hg log -b '--config=alias.log=!echo howdy'
122 howdy
125 howdy
123
126
124 Early options must come first if HGPLAIN=+strictflags is specified:
127 Early options must come first if HGPLAIN=+strictflags is specified:
125 (BUG: chg cherry-picks early options to pass them as a server command)
128 (BUG: chg cherry-picks early options to pass them as a server command)
126
129
127 #if no-chg
130 #if no-chg
128 $ HGPLAIN=+strictflags hg log -b --config='hooks.pre-log=false' default
131 $ HGPLAIN=+strictflags hg log -b --config='hooks.pre-log=false' default
129 abort: unknown revision '--config=hooks.pre-log=false'
132 abort: unknown revision '--config=hooks.pre-log=false'
130 [255]
133 [255]
131 $ HGPLAIN=+strictflags hg log -b -R. default
134 $ HGPLAIN=+strictflags hg log -b -R. default
132 abort: unknown revision '-R.'
135 abort: unknown revision '-R.'
133 [255]
136 [255]
134 $ HGPLAIN=+strictflags hg log -b --cwd=. default
137 $ HGPLAIN=+strictflags hg log -b --cwd=. default
135 abort: unknown revision '--cwd=.'
138 abort: unknown revision '--cwd=.'
136 [255]
139 [255]
137 #endif
140 #endif
138 $ HGPLAIN=+strictflags hg log -b --debugger default
141 $ HGPLAIN=+strictflags hg log -b --debugger default
139 abort: unknown revision '--debugger'
142 abort: unknown revision '--debugger'
140 [255]
143 [255]
141 $ HGPLAIN=+strictflags hg log -b --config='alias.log=!echo pwned' default
144 $ HGPLAIN=+strictflags hg log -b --config='alias.log=!echo pwned' default
142 abort: unknown revision '--config=alias.log=!echo pwned'
145 abort: unknown revision '--config=alias.log=!echo pwned'
143 [255]
146 [255]
144
147
145 $ HGPLAIN=+strictflags hg log --config='hooks.pre-log=false' -b default
148 $ HGPLAIN=+strictflags hg log --config='hooks.pre-log=false' -b default
146 abort: option --config may not be abbreviated
149 abort: option --config may not be abbreviated
147 [10]
150 [10]
148 $ HGPLAIN=+strictflags hg log -q --cwd=.. -b default
151 $ HGPLAIN=+strictflags hg log -q --cwd=.. -b default
149 abort: option --cwd may not be abbreviated
152 abort: option --cwd may not be abbreviated
150 [10]
153 [10]
151 $ HGPLAIN=+strictflags hg log -q -R . -b default
154 $ HGPLAIN=+strictflags hg log -q -R . -b default
152 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
155 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
153 [10]
156 [10]
154
157
155 $ HGPLAIN=+strictflags hg --config='hooks.pre-log=false' log -b default
158 $ HGPLAIN=+strictflags hg --config='hooks.pre-log=false' log -b default
156 abort: pre-log hook exited with status 1
159 abort: pre-log hook exited with status 1
157 [40]
160 [40]
158 $ HGPLAIN=+strictflags hg --cwd .. -q -Ra log -b default
161 $ HGPLAIN=+strictflags hg --cwd .. -q -Ra log -b default
159 0:cb9a9f314b8b
162 0:cb9a9f314b8b
160 $ HGPLAIN=+strictflags hg --cwd .. -q --repository a log -b default
163 $ HGPLAIN=+strictflags hg --cwd .. -q --repository a log -b default
161 0:cb9a9f314b8b
164 0:cb9a9f314b8b
162 $ HGPLAIN=+strictflags hg --cwd .. -q --repo a log -b default
165 $ HGPLAIN=+strictflags hg --cwd .. -q --repo a log -b default
163 0:cb9a9f314b8b
166 0:cb9a9f314b8b
164
167
165 For compatibility reasons, HGPLAIN=+strictflags is not enabled by plain HGPLAIN:
168 For compatibility reasons, HGPLAIN=+strictflags is not enabled by plain HGPLAIN:
166
169
167 $ HGPLAIN= hg log --config='hooks.pre-log=false' -b default
170 $ HGPLAIN= hg log --config='hooks.pre-log=false' -b default
168 abort: pre-log hook exited with status 1
171 abort: pre-log hook exited with status 1
169 [40]
172 [40]
170 $ HGPLAINEXCEPT= hg log --cwd .. -q -Ra -b default
173 $ HGPLAINEXCEPT= hg log --cwd .. -q -Ra -b default
171 0:cb9a9f314b8b
174 0:cb9a9f314b8b
172
175
173 [defaults]
176 [defaults]
174
177
175 $ hg cat a
178 $ hg cat a
176 a
179 a
177 $ cat >> $HGRCPATH <<EOF
180 $ cat >> $HGRCPATH <<EOF
178 > [defaults]
181 > [defaults]
179 > cat = -r null
182 > cat = -r null
180 > EOF
183 > EOF
181 $ hg cat a
184 $ hg cat a
182 a: no such file in rev 000000000000
185 a: no such file in rev 000000000000
183 [1]
186 [1]
184
187
185 $ cd "$TESTTMP"
188 $ cd "$TESTTMP"
186
189
187 OSError "No such file or directory" / "The system cannot find the path
190 OSError "No such file or directory" / "The system cannot find the path
188 specified" should include filename even when it is empty
191 specified" should include filename even when it is empty
189
192
190 $ hg -R a archive ''
193 $ hg -R a archive ''
191 abort: $ENOENT$: '' (no-windows !)
194 abort: $ENOENT$: '' (no-windows !)
192 abort: $ENOTDIR$: '' (windows !)
195 abort: $ENOTDIR$: '' (windows !)
193 [255]
196 [255]
194
197
195 #if no-outer-repo
198 #if no-outer-repo
196
199
197 No repo:
200 No repo:
198
201
199 $ hg cat
202 $ hg cat
200 abort: no repository found in '$TESTTMP' (.hg not found)
203 abort: no repository found in '$TESTTMP' (.hg not found)
201 [10]
204 [10]
202
205
203 #endif
206 #endif
204
207
205 #if rmcwd
208 #if rmcwd
206
209
207 Current directory removed:
210 Current directory removed:
208
211
209 $ mkdir $TESTTMP/repo1
212 $ mkdir $TESTTMP/repo1
210 $ cd $TESTTMP/repo1
213 $ cd $TESTTMP/repo1
211 $ rm -rf $TESTTMP/repo1
214 $ rm -rf $TESTTMP/repo1
212
215
213 The output could be one of the following and something else:
216 The output could be one of the following and something else:
214 chg: abort: failed to getcwd (errno = *) (glob)
217 chg: abort: failed to getcwd (errno = *) (glob)
215 abort: error getting current working directory: * (glob)
218 abort: error getting current working directory: * (glob)
216 sh: 0: getcwd() failed: $ENOENT$
219 sh: 0: getcwd() failed: $ENOENT$
217 Since the exact behavior depends on the shell, only check it returns non-zero.
220 Since the exact behavior depends on the shell, only check it returns non-zero.
218 $ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false
221 $ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false
219 [1]
222 [1]
220
223
221 #endif
224 #endif
@@ -1,564 +1,570 b''
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo a > a
3 $ echo a > a
4 $ hg ci -A -d'1 0' -m a
4 $ hg ci -A -d'1 0' -m a
5 adding a
5 adding a
6
6
7 $ cd ..
7 $ cd ..
8
8
9 $ hg init b
9 $ hg init b
10 $ cd b
10 $ cd b
11 $ echo b > b
11 $ echo b > b
12 $ hg ci -A -d'1 0' -m b
12 $ hg ci -A -d'1 0' -m b
13 adding b
13 adding b
14
14
15 $ cd ..
15 $ cd ..
16
16
17 $ hg clone a c
17 $ hg clone a c
18 updating to branch default
18 updating to branch default
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 $ cd c
20 $ cd c
21 $ cat >> .hg/hgrc <<EOF
21 $ cat >> .hg/hgrc <<EOF
22 > [paths]
22 > [paths]
23 > relative = ../a
23 > relative = ../a
24 > EOF
24 > EOF
25 $ hg pull -f ../b
25 $ hg pull -f ../b
26 pulling from ../b
26 pulling from ../b
27 searching for changes
27 searching for changes
28 warning: repository is unrelated
28 warning: repository is unrelated
29 requesting all changes
29 requesting all changes
30 adding changesets
30 adding changesets
31 adding manifests
31 adding manifests
32 adding file changes
32 adding file changes
33 added 1 changesets with 1 changes to 1 files (+1 heads)
33 added 1 changesets with 1 changes to 1 files (+1 heads)
34 new changesets b6c483daf290
34 new changesets b6c483daf290
35 (run 'hg heads' to see heads, 'hg merge' to merge)
35 (run 'hg heads' to see heads, 'hg merge' to merge)
36 $ hg merge
36 $ hg merge
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
38 (branch merge, don't forget to commit)
39
39
40 $ cd ..
40 $ cd ..
41
41
42 Testing -R/--repository:
42 Testing -R/--repository:
43
43
44 $ hg -R a tip
44 $ hg -R a tip
45 changeset: 0:8580ff50825a
45 changeset: 0:8580ff50825a
46 tag: tip
46 tag: tip
47 user: test
47 user: test
48 date: Thu Jan 01 00:00:01 1970 +0000
48 date: Thu Jan 01 00:00:01 1970 +0000
49 summary: a
49 summary: a
50
50
51 $ hg --repository b tip
51 $ hg --repository b tip
52 changeset: 0:b6c483daf290
52 changeset: 0:b6c483daf290
53 tag: tip
53 tag: tip
54 user: test
54 user: test
55 date: Thu Jan 01 00:00:01 1970 +0000
55 date: Thu Jan 01 00:00:01 1970 +0000
56 summary: b
56 summary: b
57
57
58
58
59 -R with a URL:
59 -R with a URL:
60
60
61 $ hg -R file:a identify
61 $ hg -R file:a identify
62 8580ff50825a tip
62 8580ff50825a tip
63 $ hg -R file://localhost/`pwd`/a/ identify
63 $ hg -R file://localhost/`pwd`/a/ identify
64 8580ff50825a tip
64 8580ff50825a tip
65
65
66 -R with path aliases:
66 -R with path aliases:
67
67
68 TODO: add rhg support for path aliases
69 #if no-rhg
68 $ cd c
70 $ cd c
69 $ hg -R default identify
71 $ hg -R default identify
70 8580ff50825a tip
72 8580ff50825a tip
71 $ hg -R relative identify
73 $ hg -R relative identify
72 8580ff50825a tip
74 8580ff50825a tip
73 $ echo '[paths]' >> $HGRCPATH
75 $ echo '[paths]' >> $HGRCPATH
74 $ echo 'relativetohome = a' >> $HGRCPATH
76 $ echo 'relativetohome = a' >> $HGRCPATH
75 $ HOME=`pwd`/../ hg -R relativetohome identify
77 $ HOME=`pwd`/../ hg -R relativetohome identify
76 8580ff50825a tip
78 8580ff50825a tip
77 $ cd ..
79 $ cd ..
80 #endif
78
81
79 #if no-outer-repo
82 #if no-outer-repo
80
83
81 Implicit -R:
84 Implicit -R:
82
85
83 $ hg ann a/a
86 $ hg ann a/a
84 0: a
87 0: a
85 $ hg ann a/a a/a
88 $ hg ann a/a a/a
86 0: a
89 0: a
87 $ hg ann a/a b/b
90 $ hg ann a/a b/b
88 abort: no repository found in '$TESTTMP' (.hg not found)
91 abort: no repository found in '$TESTTMP' (.hg not found)
89 [10]
92 [10]
90 $ hg -R b ann a/a
93 $ hg -R b ann a/a
91 abort: a/a not under root '$TESTTMP/b'
94 abort: a/a not under root '$TESTTMP/b'
92 (consider using '--cwd b')
95 (consider using '--cwd b')
93 [255]
96 [255]
94 $ hg log
97 $ hg log
95 abort: no repository found in '$TESTTMP' (.hg not found)
98 abort: no repository found in '$TESTTMP' (.hg not found)
96 [10]
99 [10]
97
100
98 #endif
101 #endif
99
102
100 Abbreviation of long option:
103 Abbreviation of long option:
101
104
102 $ hg --repo c tip
105 $ hg --repo c tip
103 changeset: 1:b6c483daf290
106 changeset: 1:b6c483daf290
104 tag: tip
107 tag: tip
105 parent: -1:000000000000
108 parent: -1:000000000000
106 user: test
109 user: test
107 date: Thu Jan 01 00:00:01 1970 +0000
110 date: Thu Jan 01 00:00:01 1970 +0000
108 summary: b
111 summary: b
109
112
110
113
111 earlygetopt with duplicate options (36d23de02da1):
114 earlygetopt with duplicate options (36d23de02da1):
112
115
113 $ hg --cwd a --cwd b --cwd c tip
116 $ hg --cwd a --cwd b --cwd c tip
114 changeset: 1:b6c483daf290
117 changeset: 1:b6c483daf290
115 tag: tip
118 tag: tip
116 parent: -1:000000000000
119 parent: -1:000000000000
117 user: test
120 user: test
118 date: Thu Jan 01 00:00:01 1970 +0000
121 date: Thu Jan 01 00:00:01 1970 +0000
119 summary: b
122 summary: b
120
123
121 $ hg --repo c --repository b -R a tip
124 $ hg --repo c --repository b -R a tip
122 changeset: 0:8580ff50825a
125 changeset: 0:8580ff50825a
123 tag: tip
126 tag: tip
124 user: test
127 user: test
125 date: Thu Jan 01 00:00:01 1970 +0000
128 date: Thu Jan 01 00:00:01 1970 +0000
126 summary: a
129 summary: a
127
130
128
131
129 earlygetopt short option without following space:
132 earlygetopt short option without following space:
130
133
131 $ hg -q -Rb tip
134 $ hg -q -Rb tip
132 0:b6c483daf290
135 0:b6c483daf290
133
136
134 earlygetopt with illegal abbreviations:
137 earlygetopt with illegal abbreviations:
135
138
136 $ hg --confi "foo.bar=baz"
139 $ hg --confi "foo.bar=baz"
137 abort: option --config may not be abbreviated
140 abort: option --config may not be abbreviated
138 [10]
141 [10]
139 $ hg --cw a tip
142 $ hg --cw a tip
140 abort: option --cwd may not be abbreviated
143 abort: option --cwd may not be abbreviated
141 [10]
144 [10]
142 $ hg --rep a tip
145 $ hg --rep a tip
143 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
146 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
144 [10]
147 [10]
145 $ hg --repositor a tip
148 $ hg --repositor a tip
146 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
149 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
147 [10]
150 [10]
148 $ hg -qR a tip
151 $ hg -qR a tip
149 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
152 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
150 [10]
153 [10]
151 $ hg -qRa tip
154 $ hg -qRa tip
152 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
155 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
153 [10]
156 [10]
154
157
155 Testing --cwd:
158 Testing --cwd:
156
159
157 $ hg --cwd a parents
160 $ hg --cwd a parents
158 changeset: 0:8580ff50825a
161 changeset: 0:8580ff50825a
159 tag: tip
162 tag: tip
160 user: test
163 user: test
161 date: Thu Jan 01 00:00:01 1970 +0000
164 date: Thu Jan 01 00:00:01 1970 +0000
162 summary: a
165 summary: a
163
166
164
167
165 Testing -y/--noninteractive - just be sure it is parsed:
168 Testing -y/--noninteractive - just be sure it is parsed:
166
169
167 $ hg --cwd a tip -q --noninteractive
170 $ hg --cwd a tip -q --noninteractive
168 0:8580ff50825a
171 0:8580ff50825a
169 $ hg --cwd a tip -q -y
172 $ hg --cwd a tip -q -y
170 0:8580ff50825a
173 0:8580ff50825a
171
174
172 Testing -q/--quiet:
175 Testing -q/--quiet:
173
176
174 $ hg -R a -q tip
177 $ hg -R a -q tip
175 0:8580ff50825a
178 0:8580ff50825a
176 $ hg -R b -q tip
179 $ hg -R b -q tip
177 0:b6c483daf290
180 0:b6c483daf290
178 $ hg -R c --quiet parents
181 $ hg -R c --quiet parents
179 0:8580ff50825a
182 0:8580ff50825a
180 1:b6c483daf290
183 1:b6c483daf290
181
184
182 Testing -v/--verbose:
185 Testing -v/--verbose:
183
186
184 $ hg --cwd c head -v
187 $ hg --cwd c head -v
185 changeset: 1:b6c483daf290
188 changeset: 1:b6c483daf290
186 tag: tip
189 tag: tip
187 parent: -1:000000000000
190 parent: -1:000000000000
188 user: test
191 user: test
189 date: Thu Jan 01 00:00:01 1970 +0000
192 date: Thu Jan 01 00:00:01 1970 +0000
190 files: b
193 files: b
191 description:
194 description:
192 b
195 b
193
196
194
197
195 changeset: 0:8580ff50825a
198 changeset: 0:8580ff50825a
196 user: test
199 user: test
197 date: Thu Jan 01 00:00:01 1970 +0000
200 date: Thu Jan 01 00:00:01 1970 +0000
198 files: a
201 files: a
199 description:
202 description:
200 a
203 a
201
204
202
205
203 $ hg --cwd b tip --verbose
206 $ hg --cwd b tip --verbose
204 changeset: 0:b6c483daf290
207 changeset: 0:b6c483daf290
205 tag: tip
208 tag: tip
206 user: test
209 user: test
207 date: Thu Jan 01 00:00:01 1970 +0000
210 date: Thu Jan 01 00:00:01 1970 +0000
208 files: b
211 files: b
209 description:
212 description:
210 b
213 b
211
214
212
215
213
216
214 Testing --config:
217 Testing --config:
215
218
216 $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
219 $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
217 quuxfoo
220 quuxfoo
221 TODO: add rhg support for detailed exit codes
222 #if no-rhg
218 $ hg --cwd c --config '' tip -q
223 $ hg --cwd c --config '' tip -q
219 abort: malformed --config option: '' (use --config section.name=value)
224 abort: malformed --config option: '' (use --config section.name=value)
220 [10]
225 [10]
221 $ hg --cwd c --config a.b tip -q
226 $ hg --cwd c --config a.b tip -q
222 abort: malformed --config option: 'a.b' (use --config section.name=value)
227 abort: malformed --config option: 'a.b' (use --config section.name=value)
223 [10]
228 [10]
224 $ hg --cwd c --config a tip -q
229 $ hg --cwd c --config a tip -q
225 abort: malformed --config option: 'a' (use --config section.name=value)
230 abort: malformed --config option: 'a' (use --config section.name=value)
226 [10]
231 [10]
227 $ hg --cwd c --config a.= tip -q
232 $ hg --cwd c --config a.= tip -q
228 abort: malformed --config option: 'a.=' (use --config section.name=value)
233 abort: malformed --config option: 'a.=' (use --config section.name=value)
229 [10]
234 [10]
230 $ hg --cwd c --config .b= tip -q
235 $ hg --cwd c --config .b= tip -q
231 abort: malformed --config option: '.b=' (use --config section.name=value)
236 abort: malformed --config option: '.b=' (use --config section.name=value)
232 [10]
237 [10]
238 #endif
233
239
234 Testing --debug:
240 Testing --debug:
235
241
236 $ hg --cwd c log --debug
242 $ hg --cwd c log --debug
237 changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
243 changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
238 tag: tip
244 tag: tip
239 phase: public
245 phase: public
240 parent: -1:0000000000000000000000000000000000000000
246 parent: -1:0000000000000000000000000000000000000000
241 parent: -1:0000000000000000000000000000000000000000
247 parent: -1:0000000000000000000000000000000000000000
242 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
248 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
243 user: test
249 user: test
244 date: Thu Jan 01 00:00:01 1970 +0000
250 date: Thu Jan 01 00:00:01 1970 +0000
245 files+: b
251 files+: b
246 extra: branch=default
252 extra: branch=default
247 description:
253 description:
248 b
254 b
249
255
250
256
251 changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
257 changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
252 phase: public
258 phase: public
253 parent: -1:0000000000000000000000000000000000000000
259 parent: -1:0000000000000000000000000000000000000000
254 parent: -1:0000000000000000000000000000000000000000
260 parent: -1:0000000000000000000000000000000000000000
255 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
261 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
256 user: test
262 user: test
257 date: Thu Jan 01 00:00:01 1970 +0000
263 date: Thu Jan 01 00:00:01 1970 +0000
258 files+: a
264 files+: a
259 extra: branch=default
265 extra: branch=default
260 description:
266 description:
261 a
267 a
262
268
263
269
264
270
265 Testing --traceback:
271 Testing --traceback:
266
272
267 #if no-chg no-rhg
273 #if no-chg no-rhg
268 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
274 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
269 Traceback (most recent call last):
275 Traceback (most recent call last):
270 Traceback (most recent call last): (py3 !)
276 Traceback (most recent call last): (py3 !)
271 #else
277 #else
272 Traceback for '--config' errors not supported with chg.
278 Traceback for '--config' errors not supported with chg.
273 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
279 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
274 [1]
280 [1]
275 #endif
281 #endif
276
282
277 Testing --time:
283 Testing --time:
278
284
279 $ hg --cwd a --time id
285 $ hg --cwd a --time id
280 8580ff50825a tip
286 8580ff50825a tip
281 time: real * (glob)
287 time: real * (glob)
282
288
283 Testing --version:
289 Testing --version:
284
290
285 $ hg --version -q
291 $ hg --version -q
286 Mercurial Distributed SCM * (glob)
292 Mercurial Distributed SCM * (glob)
287
293
288 hide outer repo
294 hide outer repo
289 $ hg init
295 $ hg init
290
296
291 Testing -h/--help:
297 Testing -h/--help:
292
298
293 #if no-extraextensions
299 #if no-extraextensions
294
300
295 $ hg -h
301 $ hg -h
296 Mercurial Distributed SCM
302 Mercurial Distributed SCM
297
303
298 list of commands:
304 list of commands:
299
305
300 Repository creation:
306 Repository creation:
301
307
302 clone make a copy of an existing repository
308 clone make a copy of an existing repository
303 init create a new repository in the given directory
309 init create a new repository in the given directory
304
310
305 Remote repository management:
311 Remote repository management:
306
312
307 incoming show new changesets found in source
313 incoming show new changesets found in source
308 outgoing show changesets not found in the destination
314 outgoing show changesets not found in the destination
309 paths show aliases for remote repositories
315 paths show aliases for remote repositories
310 pull pull changes from the specified source
316 pull pull changes from the specified source
311 push push changes to the specified destination
317 push push changes to the specified destination
312 serve start stand-alone webserver
318 serve start stand-alone webserver
313
319
314 Change creation:
320 Change creation:
315
321
316 commit commit the specified files or all outstanding changes
322 commit commit the specified files or all outstanding changes
317
323
318 Change manipulation:
324 Change manipulation:
319
325
320 backout reverse effect of earlier changeset
326 backout reverse effect of earlier changeset
321 graft copy changes from other branches onto the current branch
327 graft copy changes from other branches onto the current branch
322 merge merge another revision into working directory
328 merge merge another revision into working directory
323
329
324 Change organization:
330 Change organization:
325
331
326 bookmarks create a new bookmark or list existing bookmarks
332 bookmarks create a new bookmark or list existing bookmarks
327 branch set or show the current branch name
333 branch set or show the current branch name
328 branches list repository named branches
334 branches list repository named branches
329 phase set or show the current phase name
335 phase set or show the current phase name
330 tag add one or more tags for the current or given revision
336 tag add one or more tags for the current or given revision
331 tags list repository tags
337 tags list repository tags
332
338
333 File content management:
339 File content management:
334
340
335 annotate show changeset information by line for each file
341 annotate show changeset information by line for each file
336 cat output the current or given revision of files
342 cat output the current or given revision of files
337 copy mark files as copied for the next commit
343 copy mark files as copied for the next commit
338 diff diff repository (or selected files)
344 diff diff repository (or selected files)
339 grep search for a pattern in specified files
345 grep search for a pattern in specified files
340
346
341 Change navigation:
347 Change navigation:
342
348
343 bisect subdivision search of changesets
349 bisect subdivision search of changesets
344 heads show branch heads
350 heads show branch heads
345 identify identify the working directory or specified revision
351 identify identify the working directory or specified revision
346 log show revision history of entire repository or files
352 log show revision history of entire repository or files
347
353
348 Working directory management:
354 Working directory management:
349
355
350 add add the specified files on the next commit
356 add add the specified files on the next commit
351 addremove add all new files, delete all missing files
357 addremove add all new files, delete all missing files
352 files list tracked files
358 files list tracked files
353 forget forget the specified files on the next commit
359 forget forget the specified files on the next commit
354 purge removes files not tracked by Mercurial
360 purge removes files not tracked by Mercurial
355 remove remove the specified files on the next commit
361 remove remove the specified files on the next commit
356 rename rename files; equivalent of copy + remove
362 rename rename files; equivalent of copy + remove
357 resolve redo merges or set/view the merge status of files
363 resolve redo merges or set/view the merge status of files
358 revert restore files to their checkout state
364 revert restore files to their checkout state
359 root print the root (top) of the current working directory
365 root print the root (top) of the current working directory
360 shelve save and set aside changes from the working directory
366 shelve save and set aside changes from the working directory
361 status show changed files in the working directory
367 status show changed files in the working directory
362 summary summarize working directory state
368 summary summarize working directory state
363 unshelve restore a shelved change to the working directory
369 unshelve restore a shelved change to the working directory
364 update update working directory (or switch revisions)
370 update update working directory (or switch revisions)
365
371
366 Change import/export:
372 Change import/export:
367
373
368 archive create an unversioned archive of a repository revision
374 archive create an unversioned archive of a repository revision
369 bundle create a bundle file
375 bundle create a bundle file
370 export dump the header and diffs for one or more changesets
376 export dump the header and diffs for one or more changesets
371 import import an ordered set of patches
377 import import an ordered set of patches
372 unbundle apply one or more bundle files
378 unbundle apply one or more bundle files
373
379
374 Repository maintenance:
380 Repository maintenance:
375
381
376 manifest output the current or given revision of the project manifest
382 manifest output the current or given revision of the project manifest
377 recover roll back an interrupted transaction
383 recover roll back an interrupted transaction
378 verify verify the integrity of the repository
384 verify verify the integrity of the repository
379
385
380 Help:
386 Help:
381
387
382 config show combined config settings from all hgrc files
388 config show combined config settings from all hgrc files
383 help show help for a given topic or a help overview
389 help show help for a given topic or a help overview
384 version output version and copyright information
390 version output version and copyright information
385
391
386 additional help topics:
392 additional help topics:
387
393
388 Mercurial identifiers:
394 Mercurial identifiers:
389
395
390 filesets Specifying File Sets
396 filesets Specifying File Sets
391 hgignore Syntax for Mercurial Ignore Files
397 hgignore Syntax for Mercurial Ignore Files
392 patterns File Name Patterns
398 patterns File Name Patterns
393 revisions Specifying Revisions
399 revisions Specifying Revisions
394 urls URL Paths
400 urls URL Paths
395
401
396 Mercurial output:
402 Mercurial output:
397
403
398 color Colorizing Outputs
404 color Colorizing Outputs
399 dates Date Formats
405 dates Date Formats
400 diffs Diff Formats
406 diffs Diff Formats
401 templating Template Usage
407 templating Template Usage
402
408
403 Mercurial configuration:
409 Mercurial configuration:
404
410
405 config Configuration Files
411 config Configuration Files
406 environment Environment Variables
412 environment Environment Variables
407 extensions Using Additional Features
413 extensions Using Additional Features
408 flags Command-line flags
414 flags Command-line flags
409 hgweb Configuring hgweb
415 hgweb Configuring hgweb
410 merge-tools Merge Tools
416 merge-tools Merge Tools
411 pager Pager Support
417 pager Pager Support
412
418
413 Concepts:
419 Concepts:
414
420
415 bundlespec Bundle File Formats
421 bundlespec Bundle File Formats
416 glossary Glossary
422 glossary Glossary
417 phases Working with Phases
423 phases Working with Phases
418 subrepos Subrepositories
424 subrepos Subrepositories
419
425
420 Miscellaneous:
426 Miscellaneous:
421
427
422 deprecated Deprecated Features
428 deprecated Deprecated Features
423 internals Technical implementation topics
429 internals Technical implementation topics
424 scripting Using Mercurial from scripts and automation
430 scripting Using Mercurial from scripts and automation
425
431
426 (use 'hg help -v' to show built-in aliases and global options)
432 (use 'hg help -v' to show built-in aliases and global options)
427
433
428 $ hg --help
434 $ hg --help
429 Mercurial Distributed SCM
435 Mercurial Distributed SCM
430
436
431 list of commands:
437 list of commands:
432
438
433 Repository creation:
439 Repository creation:
434
440
435 clone make a copy of an existing repository
441 clone make a copy of an existing repository
436 init create a new repository in the given directory
442 init create a new repository in the given directory
437
443
438 Remote repository management:
444 Remote repository management:
439
445
440 incoming show new changesets found in source
446 incoming show new changesets found in source
441 outgoing show changesets not found in the destination
447 outgoing show changesets not found in the destination
442 paths show aliases for remote repositories
448 paths show aliases for remote repositories
443 pull pull changes from the specified source
449 pull pull changes from the specified source
444 push push changes to the specified destination
450 push push changes to the specified destination
445 serve start stand-alone webserver
451 serve start stand-alone webserver
446
452
447 Change creation:
453 Change creation:
448
454
449 commit commit the specified files or all outstanding changes
455 commit commit the specified files or all outstanding changes
450
456
451 Change manipulation:
457 Change manipulation:
452
458
453 backout reverse effect of earlier changeset
459 backout reverse effect of earlier changeset
454 graft copy changes from other branches onto the current branch
460 graft copy changes from other branches onto the current branch
455 merge merge another revision into working directory
461 merge merge another revision into working directory
456
462
457 Change organization:
463 Change organization:
458
464
459 bookmarks create a new bookmark or list existing bookmarks
465 bookmarks create a new bookmark or list existing bookmarks
460 branch set or show the current branch name
466 branch set or show the current branch name
461 branches list repository named branches
467 branches list repository named branches
462 phase set or show the current phase name
468 phase set or show the current phase name
463 tag add one or more tags for the current or given revision
469 tag add one or more tags for the current or given revision
464 tags list repository tags
470 tags list repository tags
465
471
466 File content management:
472 File content management:
467
473
468 annotate show changeset information by line for each file
474 annotate show changeset information by line for each file
469 cat output the current or given revision of files
475 cat output the current or given revision of files
470 copy mark files as copied for the next commit
476 copy mark files as copied for the next commit
471 diff diff repository (or selected files)
477 diff diff repository (or selected files)
472 grep search for a pattern in specified files
478 grep search for a pattern in specified files
473
479
474 Change navigation:
480 Change navigation:
475
481
476 bisect subdivision search of changesets
482 bisect subdivision search of changesets
477 heads show branch heads
483 heads show branch heads
478 identify identify the working directory or specified revision
484 identify identify the working directory or specified revision
479 log show revision history of entire repository or files
485 log show revision history of entire repository or files
480
486
481 Working directory management:
487 Working directory management:
482
488
483 add add the specified files on the next commit
489 add add the specified files on the next commit
484 addremove add all new files, delete all missing files
490 addremove add all new files, delete all missing files
485 files list tracked files
491 files list tracked files
486 forget forget the specified files on the next commit
492 forget forget the specified files on the next commit
487 purge removes files not tracked by Mercurial
493 purge removes files not tracked by Mercurial
488 remove remove the specified files on the next commit
494 remove remove the specified files on the next commit
489 rename rename files; equivalent of copy + remove
495 rename rename files; equivalent of copy + remove
490 resolve redo merges or set/view the merge status of files
496 resolve redo merges or set/view the merge status of files
491 revert restore files to their checkout state
497 revert restore files to their checkout state
492 root print the root (top) of the current working directory
498 root print the root (top) of the current working directory
493 shelve save and set aside changes from the working directory
499 shelve save and set aside changes from the working directory
494 status show changed files in the working directory
500 status show changed files in the working directory
495 summary summarize working directory state
501 summary summarize working directory state
496 unshelve restore a shelved change to the working directory
502 unshelve restore a shelved change to the working directory
497 update update working directory (or switch revisions)
503 update update working directory (or switch revisions)
498
504
499 Change import/export:
505 Change import/export:
500
506
501 archive create an unversioned archive of a repository revision
507 archive create an unversioned archive of a repository revision
502 bundle create a bundle file
508 bundle create a bundle file
503 export dump the header and diffs for one or more changesets
509 export dump the header and diffs for one or more changesets
504 import import an ordered set of patches
510 import import an ordered set of patches
505 unbundle apply one or more bundle files
511 unbundle apply one or more bundle files
506
512
507 Repository maintenance:
513 Repository maintenance:
508
514
509 manifest output the current or given revision of the project manifest
515 manifest output the current or given revision of the project manifest
510 recover roll back an interrupted transaction
516 recover roll back an interrupted transaction
511 verify verify the integrity of the repository
517 verify verify the integrity of the repository
512
518
513 Help:
519 Help:
514
520
515 config show combined config settings from all hgrc files
521 config show combined config settings from all hgrc files
516 help show help for a given topic or a help overview
522 help show help for a given topic or a help overview
517 version output version and copyright information
523 version output version and copyright information
518
524
519 additional help topics:
525 additional help topics:
520
526
521 Mercurial identifiers:
527 Mercurial identifiers:
522
528
523 filesets Specifying File Sets
529 filesets Specifying File Sets
524 hgignore Syntax for Mercurial Ignore Files
530 hgignore Syntax for Mercurial Ignore Files
525 patterns File Name Patterns
531 patterns File Name Patterns
526 revisions Specifying Revisions
532 revisions Specifying Revisions
527 urls URL Paths
533 urls URL Paths
528
534
529 Mercurial output:
535 Mercurial output:
530
536
531 color Colorizing Outputs
537 color Colorizing Outputs
532 dates Date Formats
538 dates Date Formats
533 diffs Diff Formats
539 diffs Diff Formats
534 templating Template Usage
540 templating Template Usage
535
541
536 Mercurial configuration:
542 Mercurial configuration:
537
543
538 config Configuration Files
544 config Configuration Files
539 environment Environment Variables
545 environment Environment Variables
540 extensions Using Additional Features
546 extensions Using Additional Features
541 flags Command-line flags
547 flags Command-line flags
542 hgweb Configuring hgweb
548 hgweb Configuring hgweb
543 merge-tools Merge Tools
549 merge-tools Merge Tools
544 pager Pager Support
550 pager Pager Support
545
551
546 Concepts:
552 Concepts:
547
553
548 bundlespec Bundle File Formats
554 bundlespec Bundle File Formats
549 glossary Glossary
555 glossary Glossary
550 phases Working with Phases
556 phases Working with Phases
551 subrepos Subrepositories
557 subrepos Subrepositories
552
558
553 Miscellaneous:
559 Miscellaneous:
554
560
555 deprecated Deprecated Features
561 deprecated Deprecated Features
556 internals Technical implementation topics
562 internals Technical implementation topics
557 scripting Using Mercurial from scripts and automation
563 scripting Using Mercurial from scripts and automation
558
564
559 (use 'hg help -v' to show built-in aliases and global options)
565 (use 'hg help -v' to show built-in aliases and global options)
560
566
561 #endif
567 #endif
562
568
563 Not tested: --debugger
569 Not tested: --debugger
564
570
General Comments 0
You need to be logged in to leave comments. Login now