Show More
@@ -1,175 +1,175 b'' | |||||
1 | Use hgrc within $TESTTMP |
|
1 | Use hgrc within $TESTTMP | |
2 |
|
2 | |||
3 | $ HGRCPATH=`pwd`/hgrc |
|
3 | $ HGRCPATH=`pwd`/hgrc | |
4 | $ export HGRCPATH |
|
4 | $ export HGRCPATH | |
5 |
|
5 | |||
6 | Basic syntax error |
|
6 | Basic syntax error | |
7 |
|
7 | |||
8 | $ echo "invalid" > $HGRCPATH |
|
8 | $ echo "invalid" > $HGRCPATH | |
9 | $ hg version |
|
9 | $ hg version | |
10 | hg: parse error at $TESTTMP/hgrc:1: invalid |
|
10 | hg: parse error at $TESTTMP/hgrc:1: invalid | |
11 | [255] |
|
11 | [255] | |
12 | $ echo "" > $HGRCPATH |
|
12 | $ echo "" > $HGRCPATH | |
13 |
|
13 | |||
14 | Issue1199: Can't use '%' in hgrc (eg url encoded username) |
|
14 | Issue1199: Can't use '%' in hgrc (eg url encoded username) | |
15 |
|
15 | |||
16 | $ hg init "foo%bar" |
|
16 | $ hg init "foo%bar" | |
17 | $ hg clone "foo%bar" foobar |
|
17 | $ hg clone "foo%bar" foobar | |
18 | updating to branch default |
|
18 | updating to branch default | |
19 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
19 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
20 | $ cd foobar |
|
20 | $ cd foobar | |
21 | $ cat .hg/hgrc |
|
21 | $ cat .hg/hgrc | |
22 | [paths] |
|
22 | [paths] | |
23 | default = $TESTTMP/foo%bar |
|
23 | default = $TESTTMP/foo%bar | |
24 | $ hg paths |
|
24 | $ hg paths | |
25 | default = $TESTTMP/foo%bar |
|
25 | default = $TESTTMP/foo%bar | |
26 | $ hg showconfig |
|
26 | $ hg showconfig | |
27 | bundle.mainreporoot=$TESTTMP/foobar |
|
27 | bundle.mainreporoot=$TESTTMP/foobar | |
28 | paths.default=$TESTTMP/foo%bar |
|
28 | paths.default=$TESTTMP/foo%bar | |
29 | $ cd .. |
|
29 | $ cd .. | |
30 |
|
30 | |||
31 | issue1829: wrong indentation |
|
31 | issue1829: wrong indentation | |
32 |
|
32 | |||
33 | $ echo '[foo]' > $HGRCPATH |
|
33 | $ echo '[foo]' > $HGRCPATH | |
34 | $ echo ' x = y' >> $HGRCPATH |
|
34 | $ echo ' x = y' >> $HGRCPATH | |
35 | $ hg version |
|
35 | $ hg version | |
36 | hg: parse error at $TESTTMP/hgrc:2: x = y |
|
36 | hg: parse error at $TESTTMP/hgrc:2: x = y | |
37 | [255] |
|
37 | [255] | |
38 |
|
38 | |||
39 | $ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \ |
|
39 | $ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \ | |
40 | > > $HGRCPATH |
|
40 | > > $HGRCPATH | |
41 | $ hg showconfig foo |
|
41 | $ hg showconfig foo | |
42 | foo.bar=a\nb\nc\nde\nfg |
|
42 | foo.bar=a\nb\nc\nde\nfg | |
43 | foo.baz=bif cb |
|
43 | foo.baz=bif cb | |
44 |
|
44 | |||
45 | $ FAKEPATH=/path/to/nowhere |
|
45 | $ FAKEPATH=/path/to/nowhere | |
46 | $ export FAKEPATH |
|
46 | $ export FAKEPATH | |
47 | $ echo '%include $FAKEPATH/no-such-file' > $HGRCPATH |
|
47 | $ echo '%include $FAKEPATH/no-such-file' > $HGRCPATH | |
48 | $ hg version |
|
48 | $ hg version | |
49 |
Mercurial Distributed SCM (version |
|
49 | Mercurial Distributed SCM (version *) (glob) | |
50 | (see http://mercurial.selenic.com for more information) |
|
50 | (see http://mercurial.selenic.com for more information) | |
51 |
|
51 | |||
52 | Copyright (C) 2005-2011 Matt Mackall and others |
|
52 | Copyright (C) 2005-2011 Matt Mackall and others | |
53 | This is free software; see the source for copying conditions. There is NO |
|
53 | This is free software; see the source for copying conditions. There is NO | |
54 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
54 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
55 | $ unset FAKEPATH |
|
55 | $ unset FAKEPATH | |
56 |
|
56 | |||
57 | username expansion |
|
57 | username expansion | |
58 |
|
58 | |||
59 | $ olduser=$HGUSER |
|
59 | $ olduser=$HGUSER | |
60 | $ unset HGUSER |
|
60 | $ unset HGUSER | |
61 |
|
61 | |||
62 | $ FAKEUSER='John Doe' |
|
62 | $ FAKEUSER='John Doe' | |
63 | $ export FAKEUSER |
|
63 | $ export FAKEUSER | |
64 | $ echo '[ui]' > $HGRCPATH |
|
64 | $ echo '[ui]' > $HGRCPATH | |
65 | $ echo 'username = $FAKEUSER' >> $HGRCPATH |
|
65 | $ echo 'username = $FAKEUSER' >> $HGRCPATH | |
66 |
|
66 | |||
67 | $ hg init usertest |
|
67 | $ hg init usertest | |
68 | $ cd usertest |
|
68 | $ cd usertest | |
69 | $ touch bar |
|
69 | $ touch bar | |
70 | $ hg commit --addremove --quiet -m "added bar" |
|
70 | $ hg commit --addremove --quiet -m "added bar" | |
71 | $ hg log --template "{author}\n" |
|
71 | $ hg log --template "{author}\n" | |
72 | John Doe |
|
72 | John Doe | |
73 | $ cd .. |
|
73 | $ cd .. | |
74 |
|
74 | |||
75 | $ hg showconfig |
|
75 | $ hg showconfig | |
76 | ui.username=$FAKEUSER |
|
76 | ui.username=$FAKEUSER | |
77 |
|
77 | |||
78 | $ unset FAKEUSER |
|
78 | $ unset FAKEUSER | |
79 | $ HGUSER=$olduser |
|
79 | $ HGUSER=$olduser | |
80 | $ export HGUSER |
|
80 | $ export HGUSER | |
81 |
|
81 | |||
82 | showconfig with multiple arguments |
|
82 | showconfig with multiple arguments | |
83 |
|
83 | |||
84 | $ echo "[alias]" > $HGRCPATH |
|
84 | $ echo "[alias]" > $HGRCPATH | |
85 | $ echo "log = log -g" >> $HGRCPATH |
|
85 | $ echo "log = log -g" >> $HGRCPATH | |
86 | $ echo "[defaults]" >> $HGRCPATH |
|
86 | $ echo "[defaults]" >> $HGRCPATH | |
87 | $ echo "identify = -n" >> $HGRCPATH |
|
87 | $ echo "identify = -n" >> $HGRCPATH | |
88 | $ hg showconfig alias defaults |
|
88 | $ hg showconfig alias defaults | |
89 | alias.log=log -g |
|
89 | alias.log=log -g | |
90 | defaults.identify=-n |
|
90 | defaults.identify=-n | |
91 | $ hg showconfig alias defaults.identify |
|
91 | $ hg showconfig alias defaults.identify | |
92 | abort: only one config item permitted |
|
92 | abort: only one config item permitted | |
93 | [255] |
|
93 | [255] | |
94 | $ hg showconfig alias.log defaults.identify |
|
94 | $ hg showconfig alias.log defaults.identify | |
95 | abort: only one config item permitted |
|
95 | abort: only one config item permitted | |
96 | [255] |
|
96 | [255] | |
97 |
|
97 | |||
98 | HGPLAIN |
|
98 | HGPLAIN | |
99 |
|
99 | |||
100 | $ cd .. |
|
100 | $ cd .. | |
101 | $ p=`pwd` |
|
101 | $ p=`pwd` | |
102 | $ echo "[ui]" > $HGRCPATH |
|
102 | $ echo "[ui]" > $HGRCPATH | |
103 | $ echo "debug=true" >> $HGRCPATH |
|
103 | $ echo "debug=true" >> $HGRCPATH | |
104 | $ echo "fallbackencoding=ASCII" >> $HGRCPATH |
|
104 | $ echo "fallbackencoding=ASCII" >> $HGRCPATH | |
105 | $ echo "quiet=true" >> $HGRCPATH |
|
105 | $ echo "quiet=true" >> $HGRCPATH | |
106 | $ echo "slash=true" >> $HGRCPATH |
|
106 | $ echo "slash=true" >> $HGRCPATH | |
107 | $ echo "traceback=true" >> $HGRCPATH |
|
107 | $ echo "traceback=true" >> $HGRCPATH | |
108 | $ echo "verbose=true" >> $HGRCPATH |
|
108 | $ echo "verbose=true" >> $HGRCPATH | |
109 | $ echo "style=~/.hgstyle" >> $HGRCPATH |
|
109 | $ echo "style=~/.hgstyle" >> $HGRCPATH | |
110 | $ echo "logtemplate={node}" >> $HGRCPATH |
|
110 | $ echo "logtemplate={node}" >> $HGRCPATH | |
111 | $ echo "[defaults]" >> $HGRCPATH |
|
111 | $ echo "[defaults]" >> $HGRCPATH | |
112 | $ echo "identify=-n" >> $HGRCPATH |
|
112 | $ echo "identify=-n" >> $HGRCPATH | |
113 | $ echo "[alias]" >> $HGRCPATH |
|
113 | $ echo "[alias]" >> $HGRCPATH | |
114 | $ echo "log=log -g" >> $HGRCPATH |
|
114 | $ echo "log=log -g" >> $HGRCPATH | |
115 |
|
115 | |||
116 | customized hgrc |
|
116 | customized hgrc | |
117 |
|
117 | |||
118 | $ hg showconfig |
|
118 | $ hg showconfig | |
119 | read config from: $TESTTMP/hgrc |
|
119 | read config from: $TESTTMP/hgrc | |
120 | $TESTTMP/hgrc:13: alias.log=log -g |
|
120 | $TESTTMP/hgrc:13: alias.log=log -g | |
121 | $TESTTMP/hgrc:11: defaults.identify=-n |
|
121 | $TESTTMP/hgrc:11: defaults.identify=-n | |
122 | $TESTTMP/hgrc:2: ui.debug=true |
|
122 | $TESTTMP/hgrc:2: ui.debug=true | |
123 | $TESTTMP/hgrc:3: ui.fallbackencoding=ASCII |
|
123 | $TESTTMP/hgrc:3: ui.fallbackencoding=ASCII | |
124 | $TESTTMP/hgrc:4: ui.quiet=true |
|
124 | $TESTTMP/hgrc:4: ui.quiet=true | |
125 | $TESTTMP/hgrc:5: ui.slash=true |
|
125 | $TESTTMP/hgrc:5: ui.slash=true | |
126 | $TESTTMP/hgrc:6: ui.traceback=true |
|
126 | $TESTTMP/hgrc:6: ui.traceback=true | |
127 | $TESTTMP/hgrc:7: ui.verbose=true |
|
127 | $TESTTMP/hgrc:7: ui.verbose=true | |
128 | $TESTTMP/hgrc:8: ui.style=~/.hgstyle |
|
128 | $TESTTMP/hgrc:8: ui.style=~/.hgstyle | |
129 | $TESTTMP/hgrc:9: ui.logtemplate={node} |
|
129 | $TESTTMP/hgrc:9: ui.logtemplate={node} | |
130 |
|
130 | |||
131 | plain hgrc |
|
131 | plain hgrc | |
132 |
|
132 | |||
133 | $ HGPLAIN=; export HGPLAIN |
|
133 | $ HGPLAIN=; export HGPLAIN | |
134 | $ hg showconfig --config ui.traceback=True --debug |
|
134 | $ hg showconfig --config ui.traceback=True --debug | |
135 | read config from: $TESTTMP/hgrc |
|
135 | read config from: $TESTTMP/hgrc | |
136 | none: ui.traceback=True |
|
136 | none: ui.traceback=True | |
137 | none: ui.verbose=False |
|
137 | none: ui.verbose=False | |
138 | none: ui.debug=True |
|
138 | none: ui.debug=True | |
139 | none: ui.quiet=False |
|
139 | none: ui.quiet=False | |
140 |
|
140 | |||
141 | plain mode with exceptions |
|
141 | plain mode with exceptions | |
142 |
|
142 | |||
143 | $ cat > plain.py <<EOF |
|
143 | $ cat > plain.py <<EOF | |
144 | > def uisetup(ui): |
|
144 | > def uisetup(ui): | |
145 | > ui.write('plain: %r\n' % ui.plain()) |
|
145 | > ui.write('plain: %r\n' % ui.plain()) | |
146 | > EOF |
|
146 | > EOF | |
147 | $ echo "[extensions]" >> $HGRCPATH |
|
147 | $ echo "[extensions]" >> $HGRCPATH | |
148 | $ echo "plain=./plain.py" >> $HGRCPATH |
|
148 | $ echo "plain=./plain.py" >> $HGRCPATH | |
149 | $ HGPLAINEXCEPT=; export HGPLAINEXCEPT |
|
149 | $ HGPLAINEXCEPT=; export HGPLAINEXCEPT | |
150 | $ hg showconfig --config ui.traceback=True --debug |
|
150 | $ hg showconfig --config ui.traceback=True --debug | |
151 | plain: True |
|
151 | plain: True | |
152 | read config from: $TESTTMP/hgrc |
|
152 | read config from: $TESTTMP/hgrc | |
153 | $TESTTMP/hgrc:15: extensions.plain=./plain.py |
|
153 | $TESTTMP/hgrc:15: extensions.plain=./plain.py | |
154 | none: ui.traceback=True |
|
154 | none: ui.traceback=True | |
155 | none: ui.verbose=False |
|
155 | none: ui.verbose=False | |
156 | none: ui.debug=True |
|
156 | none: ui.debug=True | |
157 | none: ui.quiet=False |
|
157 | none: ui.quiet=False | |
158 | $ unset HGPLAIN |
|
158 | $ unset HGPLAIN | |
159 | $ hg showconfig --config ui.traceback=True --debug |
|
159 | $ hg showconfig --config ui.traceback=True --debug | |
160 | plain: True |
|
160 | plain: True | |
161 | read config from: $TESTTMP/hgrc |
|
161 | read config from: $TESTTMP/hgrc | |
162 | $TESTTMP/hgrc:15: extensions.plain=./plain.py |
|
162 | $TESTTMP/hgrc:15: extensions.plain=./plain.py | |
163 | none: ui.traceback=True |
|
163 | none: ui.traceback=True | |
164 | none: ui.verbose=False |
|
164 | none: ui.verbose=False | |
165 | none: ui.debug=True |
|
165 | none: ui.debug=True | |
166 | none: ui.quiet=False |
|
166 | none: ui.quiet=False | |
167 | $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT |
|
167 | $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT | |
168 | $ hg showconfig --config ui.traceback=True --debug |
|
168 | $ hg showconfig --config ui.traceback=True --debug | |
169 | plain: True |
|
169 | plain: True | |
170 | read config from: $TESTTMP/hgrc |
|
170 | read config from: $TESTTMP/hgrc | |
171 | $TESTTMP/hgrc:15: extensions.plain=./plain.py |
|
171 | $TESTTMP/hgrc:15: extensions.plain=./plain.py | |
172 | none: ui.traceback=True |
|
172 | none: ui.traceback=True | |
173 | none: ui.verbose=False |
|
173 | none: ui.verbose=False | |
174 | none: ui.debug=True |
|
174 | none: ui.debug=True | |
175 | none: ui.quiet=False |
|
175 | none: ui.quiet=False |
General Comments 0
You need to be logged in to leave comments.
Login now