author | Erik Zielke <ez@aragost.com> |
Thu, 23 Sep 2010 15:18:10 +0200 | |
changeset 12539 | dece1f46f7a2 |
parent 12399 | 4fee1fd3de9a |
child 12640 | 6cc4b14fb76b |
permissions | -rw-r--r-- |
12014 | 1 |
$ echo "invalid" > $HGRCPATH |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
2 |
$ hg version |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
3 |
hg: parse error at */.hgrc:1: invalid (glob) |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
4 |
[255] |
12014 | 5 |
$ 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
|
6 |
|
12399
4fee1fd3de9a
tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents:
12376
diff
changeset
|
7 |
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
|
8 |
|
12014 | 9 |
$ hg init "foo%bar" |
10 |
$ hg clone "foo%bar" foobar |
|
11 |
updating to branch default |
|
12 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
13 |
$ p=`pwd` |
|
14 |
$ cd foobar |
|
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
15 |
$ cat .hg/hgrc |
12014 | 16 |
[paths] |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
17 |
default = */foo%bar (glob) |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
18 |
$ hg paths |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
19 |
default = */foo%bar (glob) |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
20 |
$ hg showconfig |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
21 |
bundle.mainreporoot=*/foobar (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
22 |
paths.default=*/foo%bar (glob) |
12014 | 23 |
$ cd .. |
24 |
||
25 |
issue1829: wrong indentation |
|
9470
ba75830d17a9
dispatch: catch ConfigError while constructing ui
Martin Geisler <mg@lazybytes.net>
parents:
7044
diff
changeset
|
26 |
|
12014 | 27 |
$ echo '[foo]' > $HGRCPATH |
28 |
$ 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
|
29 |
$ hg version |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
30 |
hg: parse error at */.hgrc:2: x = y (glob) |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
31 |
[255] |
10042
7cdd2a7db2c2
config: raise ConfigError on non-existing include files
Martin Geisler <mg@lazybytes.net>
parents:
9470
diff
changeset
|
32 |
|
12014 | 33 |
$ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \ |
34 |
> > $HGRCPATH |
|
35 |
$ hg showconfig foo |
|
36 |
foo.bar=a\nb\nc\nde\nfg |
|
37 |
foo.baz=bif cb |
|
10295
44c923eeb81d
config: handle short continuations (issue1999)
Matt Mackall <mpm@selenic.com>
parents:
10042
diff
changeset
|
38 |
|
12014 | 39 |
$ FAKEPATH=/path/to/nowhere |
40 |
$ export FAKEPATH |
|
41 |
$ 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
|
42 |
$ hg version |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
43 |
hg: parse error at */.hgrc:1: cannot include /path/to/nowhere/no-such-file (No such file or directory) (glob) |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
44 |
[255] |
12014 | 45 |
$ unset FAKEPATH |
10455
40dfd46d098f
ui: add HGPLAIN environment variable for easier scripting
Brodie Rao <me+hg@dackz.net>
parents:
10296
diff
changeset
|
46 |
|
12014 | 47 |
username expansion |
48 |
||
49 |
$ olduser=$HGUSER |
|
50 |
$ unset HGUSER |
|
51 |
||
52 |
$ FAKEUSER='John Doe' |
|
53 |
$ export FAKEUSER |
|
54 |
$ echo '[ui]' > $HGRCPATH |
|
55 |
$ echo 'username = $FAKEUSER' >> $HGRCPATH |
|
11225
d6dbd5e4ee72
ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents:
11224
diff
changeset
|
56 |
|
12014 | 57 |
$ hg init usertest |
58 |
$ cd usertest |
|
59 |
$ touch bar |
|
60 |
$ hg commit --addremove --quiet -m "added bar" |
|
61 |
$ hg log --template "{author}\n" |
|
62 |
John Doe |
|
63 |
$ cd .. |
|
11225
d6dbd5e4ee72
ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents:
11224
diff
changeset
|
64 |
|
12109
51272b65b9b7
tests: remove useless sed in test-hgrc
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
12014
diff
changeset
|
65 |
$ hg showconfig |
12014 | 66 |
ui.username=$FAKEUSER |
11225
d6dbd5e4ee72
ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents:
11224
diff
changeset
|
67 |
|
12014 | 68 |
$ unset FAKEUSER |
69 |
$ HGUSER=$olduser |
|
70 |
$ export HGUSER |
|
11225
d6dbd5e4ee72
ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents:
11224
diff
changeset
|
71 |
|
12014 | 72 |
HGPLAIN |
11225
d6dbd5e4ee72
ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents:
11224
diff
changeset
|
73 |
|
12014 | 74 |
$ cd .. |
75 |
$ p=`pwd` |
|
76 |
$ echo "[ui]" > $HGRCPATH |
|
77 |
$ echo "debug=true" >> $HGRCPATH |
|
78 |
$ echo "fallbackencoding=ASCII" >> $HGRCPATH |
|
79 |
$ echo "quiet=true" >> $HGRCPATH |
|
80 |
$ echo "slash=true" >> $HGRCPATH |
|
81 |
$ echo "traceback=true" >> $HGRCPATH |
|
82 |
$ echo "verbose=true" >> $HGRCPATH |
|
83 |
$ echo "style=~/.hgstyle" >> $HGRCPATH |
|
84 |
$ echo "logtemplate={node}" >> $HGRCPATH |
|
85 |
$ echo "[defaults]" >> $HGRCPATH |
|
86 |
$ echo "identify=-n" >> $HGRCPATH |
|
87 |
$ echo "[alias]" >> $HGRCPATH |
|
88 |
$ echo "log=log -g" >> $HGRCPATH |
|
89 |
||
90 |
customized hgrc |
|
10455
40dfd46d098f
ui: add HGPLAIN environment variable for easier scripting
Brodie Rao <me+hg@dackz.net>
parents:
10296
diff
changeset
|
91 |
|
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
92 |
$ hg showconfig |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
93 |
read config from: */.hgrc (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
94 |
*/.hgrc:13: alias.log=log -g (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
95 |
*/.hgrc:11: defaults.identify=-n (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
96 |
*/.hgrc:2: ui.debug=true (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
97 |
*/.hgrc:3: ui.fallbackencoding=ASCII (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
98 |
*/.hgrc:4: ui.quiet=true (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
99 |
*/.hgrc:5: ui.slash=true (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
100 |
*/.hgrc:6: ui.traceback=true (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
101 |
*/.hgrc:7: ui.verbose=true (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
102 |
*/.hgrc:8: ui.style=~/.hgstyle (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
103 |
*/.hgrc:9: ui.logtemplate={node} (glob) |
10455
40dfd46d098f
ui: add HGPLAIN environment variable for easier scripting
Brodie Rao <me+hg@dackz.net>
parents:
10296
diff
changeset
|
104 |
|
12014 | 105 |
plain hgrc |
106 |
||
107 |
$ HGPLAIN=; export HGPLAIN |
|
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
108 |
$ hg showconfig --config ui.traceback=True --debug |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
109 |
read config from: */.hgrc (glob) |
12014 | 110 |
none: ui.traceback=True |
111 |
none: ui.verbose=False |
|
112 |
none: ui.debug=True |
|
113 |
none: ui.quiet=False |