annotate tests/test-hgrc.t @ 14007:d764463b433e

atomictempfile: avoid infinite recursion in __del__(). The problem is that a programmer using atomictempfile directly can make an innocent everyday mistake -- not enough args to the constructor -- which escalates badly. You would expect a simple TypeError crash in that case, but you actually get an infinite recursion that is surprisingly difficult to kill: it happens between __del__() and __getattr__(), and Python does not handle infinite recursion from __del__() well. The fix is to not implement __getattr__(), but instead assign instance attributes for the methods we wish to delegate to the builtin file type: write() and fileno(). I've audited mercurial.* and hgext.* and found no users of atomictempfile using methods other than write() and rename(). I audited third-party extensions and found one (snap) passing an atomictempfile to util.fstat(), so I also threw in fileno(). The last time I submitted a similar patch, Matt proposed that we make atomictempfile a subclass of file instead of wrapping it. Rejected on grounds of unnecessary complexity: for one thing, it would make the Windows implementation of posixfile quite a bit more complex. It would have to become a subclass of file rather than a simple function -- but since it's written in C, this is non-obvious and non-trivial. Furthermore, there's nothing wrong with wrapping objects and delegating methods: it's a well-established pattern that works just fine in many cases. Subclassing is not the answer to all of life's problems.
author Greg Ward <greg@gerg.ca>
date Sun, 24 Apr 2011 19:25:10 -0400
parents 9f97de157aad
children be0daa0eeb3e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
1 Use hgrc within $TESTTMP
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
2
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
3 $ HGRCPATH=`pwd`/hgrc
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
4 $ export HGRCPATH
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
5
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
6 Basic syntax error
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
7
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
8 $ echo "invalid" > $HGRCPATH
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
9 $ hg version
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
10 hg: parse error at $TESTTMP/hgrc:1: invalid
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
11 [255]
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
12 $ echo "" > $HGRCPATH
1473
7d66ce9895fa make readconfig take a filename instead of a file pointer as argument
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
13
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12376
diff changeset
14 Issue1199: Can't use '%' in hgrc (eg url encoded username)
7044
e51c0f41f271 Escape '%' when writing to hgrc (issue1199)
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 4659
diff changeset
15
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
16 $ hg init "foo%bar"
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
17 $ hg clone "foo%bar" foobar
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
18 updating to branch default
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
19 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
20 $ cd foobar
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
21 $ cat .hg/hgrc
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
22 [paths]
13572
1bb2a56a9d73 tests: use $TESTTMP more and use (glob) less
Martin Geisler <mg@aragost.com>
parents: 12697
diff changeset
23 default = $TESTTMP/foo%bar
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
24 $ hg paths
13572
1bb2a56a9d73 tests: use $TESTTMP more and use (glob) less
Martin Geisler <mg@aragost.com>
parents: 12697
diff changeset
25 default = $TESTTMP/foo%bar
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
26 $ hg showconfig
13572
1bb2a56a9d73 tests: use $TESTTMP more and use (glob) less
Martin Geisler <mg@aragost.com>
parents: 12697
diff changeset
27 bundle.mainreporoot=$TESTTMP/foobar
1bb2a56a9d73 tests: use $TESTTMP more and use (glob) less
Martin Geisler <mg@aragost.com>
parents: 12697
diff changeset
28 paths.default=$TESTTMP/foo%bar
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
29 $ cd ..
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
30
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
31 issue1829: wrong indentation
9470
ba75830d17a9 dispatch: catch ConfigError while constructing ui
Martin Geisler <mg@lazybytes.net>
parents: 7044
diff changeset
32
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
33 $ echo '[foo]' > $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
34 $ echo ' x = y' >> $HGRCPATH
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
35 $ hg version
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
36 hg: parse error at $TESTTMP/hgrc:2: x = y
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
37 [255]
10042
7cdd2a7db2c2 config: raise ConfigError on non-existing include files
Martin Geisler <mg@lazybytes.net>
parents: 9470
diff changeset
38
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
39 $ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
40 > > $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
41 $ hg showconfig foo
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
42 foo.bar=a\nb\nc\nde\nfg
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
43 foo.baz=bif cb
10295
44c923eeb81d config: handle short continuations (issue1999)
Matt Mackall <mpm@selenic.com>
parents: 10042
diff changeset
44
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
45 $ FAKEPATH=/path/to/nowhere
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
46 $ export FAKEPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
47 $ echo '%include $FAKEPATH/no-such-file' > $HGRCPATH
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
48 $ hg version
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
49 hg: parse error at $TESTTMP/hgrc:1: cannot include /path/to/nowhere/no-such-file (No such file or directory)
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
50 [255]
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
51 $ unset FAKEPATH
10455
40dfd46d098f ui: add HGPLAIN environment variable for easier scripting
Brodie Rao <me+hg@dackz.net>
parents: 10296
diff changeset
52
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
53 username expansion
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
54
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
55 $ olduser=$HGUSER
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
56 $ unset HGUSER
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
57
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
58 $ FAKEUSER='John Doe'
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
59 $ export FAKEUSER
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
60 $ echo '[ui]' > $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
61 $ echo 'username = $FAKEUSER' >> $HGRCPATH
11225
d6dbd5e4ee72 ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents: 11224
diff changeset
62
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
63 $ hg init usertest
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
64 $ cd usertest
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
65 $ touch bar
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
66 $ hg commit --addremove --quiet -m "added bar"
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
67 $ hg log --template "{author}\n"
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
68 John Doe
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
69 $ cd ..
11225
d6dbd5e4ee72 ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents: 11224
diff changeset
70
12109
51272b65b9b7 tests: remove useless sed in test-hgrc
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 12014
diff changeset
71 $ hg showconfig
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
72 ui.username=$FAKEUSER
11225
d6dbd5e4ee72 ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents: 11224
diff changeset
73
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
74 $ unset FAKEUSER
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
75 $ HGUSER=$olduser
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
76 $ export HGUSER
11225
d6dbd5e4ee72 ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents: 11224
diff changeset
77
12697
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
78 showconfig with multiple arguments
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
79
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
80 $ echo "[alias]" > $HGRCPATH
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
81 $ echo "log = log -g" >> $HGRCPATH
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
82 $ echo "[defaults]" >> $HGRCPATH
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
83 $ echo "identify = -n" >> $HGRCPATH
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
84 $ hg showconfig alias defaults
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
85 alias.log=log -g
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
86 defaults.identify=-n
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
87 $ hg showconfig alias defaults.identify
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
88 abort: only one config item permitted
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
89 [255]
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
90 $ hg showconfig alias.log defaults.identify
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
91 abort: only one config item permitted
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
92 [255]
14853ca7e11b showconfig: don't accept multiple sections and one config item
Brodie Rao <brodie@bitheap.org>
parents: 12640
diff changeset
93
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
94 HGPLAIN
11225
d6dbd5e4ee72 ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents: 11224
diff changeset
95
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
96 $ cd ..
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
97 $ p=`pwd`
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
98 $ echo "[ui]" > $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
99 $ echo "debug=true" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
100 $ echo "fallbackencoding=ASCII" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
101 $ echo "quiet=true" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
102 $ echo "slash=true" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
103 $ echo "traceback=true" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
104 $ echo "verbose=true" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
105 $ echo "style=~/.hgstyle" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
106 $ echo "logtemplate={node}" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
107 $ echo "[defaults]" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
108 $ echo "identify=-n" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
109 $ echo "[alias]" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
110 $ echo "log=log -g" >> $HGRCPATH
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
111
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
112 customized hgrc
10455
40dfd46d098f ui: add HGPLAIN environment variable for easier scripting
Brodie Rao <me+hg@dackz.net>
parents: 10296
diff changeset
113
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
114 $ hg showconfig
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
115 read config from: $TESTTMP/hgrc
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
116 $TESTTMP/hgrc:13: alias.log=log -g
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
117 $TESTTMP/hgrc:11: defaults.identify=-n
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
118 $TESTTMP/hgrc:2: ui.debug=true
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
119 $TESTTMP/hgrc:3: ui.fallbackencoding=ASCII
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
120 $TESTTMP/hgrc:4: ui.quiet=true
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
121 $TESTTMP/hgrc:5: ui.slash=true
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
122 $TESTTMP/hgrc:6: ui.traceback=true
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
123 $TESTTMP/hgrc:7: ui.verbose=true
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
124 $TESTTMP/hgrc:8: ui.style=~/.hgstyle
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
125 $TESTTMP/hgrc:9: ui.logtemplate={node}
10455
40dfd46d098f ui: add HGPLAIN environment variable for easier scripting
Brodie Rao <me+hg@dackz.net>
parents: 10296
diff changeset
126
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
127 plain hgrc
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
128
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
129 $ HGPLAIN=; export HGPLAIN
12366
c01dc9087d9a tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents: 12109
diff changeset
130 $ hg showconfig --config ui.traceback=True --debug
12640
6cc4b14fb76b tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents: 12399
diff changeset
131 read config from: $TESTTMP/hgrc
12014
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
132 none: ui.traceback=True
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
133 none: ui.verbose=False
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
134 none: ui.debug=True
8508dd698c02 tests: unify test-hgrc
Brodie Rao <brodie@bitheap.org>
parents: 11225
diff changeset
135 none: ui.quiet=False
13849
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
136
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
137 plain mode with exceptions
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
138
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
139 $ cat > plain.py <<EOF
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
140 > def uisetup(ui):
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
141 > ui.write('plain: %r\n' % ui.plain())
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
142 > EOF
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
143 $ echo "[extensions]" >> $HGRCPATH
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
144 $ echo "plain=./plain.py" >> $HGRCPATH
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
145 $ HGPLAINEXCEPT=; export HGPLAINEXCEPT
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
146 $ hg showconfig --config ui.traceback=True --debug
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
147 plain: ['']
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
148 read config from: $TESTTMP/hgrc
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
149 $TESTTMP/hgrc:15: extensions.plain=./plain.py
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
150 none: ui.traceback=True
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
151 none: ui.verbose=False
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
152 none: ui.debug=True
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
153 none: ui.quiet=False
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
154 $ unset HGPLAIN
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
155 $ hg showconfig --config ui.traceback=True --debug
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
156 plain: ['']
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
157 read config from: $TESTTMP/hgrc
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
158 $TESTTMP/hgrc:15: extensions.plain=./plain.py
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
159 none: ui.traceback=True
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
160 none: ui.verbose=False
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
161 none: ui.debug=True
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
162 none: ui.quiet=False
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
163 $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
164 $ hg showconfig --config ui.traceback=True --debug
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
165 plain: ['i18n']
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
166 read config from: $TESTTMP/hgrc
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
167 $TESTTMP/hgrc:15: extensions.plain=./plain.py
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
168 none: ui.traceback=True
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
169 none: ui.verbose=False
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
170 none: ui.debug=True
9f97de157aad HGPLAIN: allow exceptions to plain mode, like i18n, via HGPLAINEXCEPT
Brodie Rao <brodie@bitheap.org>
parents: 13572
diff changeset
171 none: ui.quiet=False