author | Mads Kiilerich <mads@kiilerich.com> |
Fri, 08 Oct 2010 22:36:10 -0500 | |
changeset 12640 | 6cc4b14fb76b |
parent 12399 | 4fee1fd3de9a |
child 12697 | 14853ca7e11b |
permissions | -rw-r--r-- |
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 | 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 | 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 | 16 |
$ hg init "foo%bar" |
17 |
$ hg clone "foo%bar" foobar |
|
18 |
updating to branch default |
|
19 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
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 | 22 |
[paths] |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
23 |
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
|
24 |
$ hg paths |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
25 |
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
|
26 |
$ hg showconfig |
12376
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
27 |
bundle.mainreporoot=*/foobar (glob) |
97ffc68f71d3
tests: add glob matching for unified tests
Brodie Rao <brodie@bitheap.org>
parents:
12375
diff
changeset
|
28 |
paths.default=*/foo%bar (glob) |
12014 | 29 |
$ cd .. |
30 |
||
31 |
issue1829: wrong indentation |
|
9470
ba75830d17a9
dispatch: catch ConfigError while constructing ui
Martin Geisler <mg@lazybytes.net>
parents:
7044
diff
changeset
|
32 |
|
12014 | 33 |
$ echo '[foo]' > $HGRCPATH |
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 | 39 |
$ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \ |
40 |
> > $HGRCPATH |
|
41 |
$ hg showconfig foo |
|
42 |
foo.bar=a\nb\nc\nde\nfg |
|
43 |
foo.baz=bif cb |
|
10295
44c923eeb81d
config: handle short continuations (issue1999)
Matt Mackall <mpm@selenic.com>
parents:
10042
diff
changeset
|
44 |
|
12014 | 45 |
$ FAKEPATH=/path/to/nowhere |
46 |
$ export FAKEPATH |
|
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 | 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 | 53 |
username expansion |
54 |
||
55 |
$ olduser=$HGUSER |
|
56 |
$ unset HGUSER |
|
57 |
||
58 |
$ FAKEUSER='John Doe' |
|
59 |
$ export FAKEUSER |
|
60 |
$ echo '[ui]' > $HGRCPATH |
|
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 | 63 |
$ hg init usertest |
64 |
$ cd usertest |
|
65 |
$ touch bar |
|
66 |
$ hg commit --addremove --quiet -m "added bar" |
|
67 |
$ hg log --template "{author}\n" |
|
68 |
John Doe |
|
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 | 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 | 74 |
$ unset FAKEUSER |
75 |
$ HGUSER=$olduser |
|
76 |
$ export HGUSER |
|
11225
d6dbd5e4ee72
ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents:
11224
diff
changeset
|
77 |
|
12014 | 78 |
HGPLAIN |
11225
d6dbd5e4ee72
ui.username(): expand environment variables in username configuration value.
Chad Dombrova <chadrik@gmail.com>
parents:
11224
diff
changeset
|
79 |
|
12014 | 80 |
$ cd .. |
81 |
$ p=`pwd` |
|
82 |
$ echo "[ui]" > $HGRCPATH |
|
83 |
$ echo "debug=true" >> $HGRCPATH |
|
84 |
$ echo "fallbackencoding=ASCII" >> $HGRCPATH |
|
85 |
$ echo "quiet=true" >> $HGRCPATH |
|
86 |
$ echo "slash=true" >> $HGRCPATH |
|
87 |
$ echo "traceback=true" >> $HGRCPATH |
|
88 |
$ echo "verbose=true" >> $HGRCPATH |
|
89 |
$ echo "style=~/.hgstyle" >> $HGRCPATH |
|
90 |
$ echo "logtemplate={node}" >> $HGRCPATH |
|
91 |
$ echo "[defaults]" >> $HGRCPATH |
|
92 |
$ echo "identify=-n" >> $HGRCPATH |
|
93 |
$ echo "[alias]" >> $HGRCPATH |
|
94 |
$ echo "log=log -g" >> $HGRCPATH |
|
95 |
||
96 |
customized hgrc |
|
10455
40dfd46d098f
ui: add HGPLAIN environment variable for easier scripting
Brodie Rao <me+hg@dackz.net>
parents:
10296
diff
changeset
|
97 |
|
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
98 |
$ hg showconfig |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
99 |
read config from: $TESTTMP/hgrc |
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
100 |
$TESTTMP/hgrc:13: alias.log=log -g |
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
101 |
$TESTTMP/hgrc:11: defaults.identify=-n |
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
102 |
$TESTTMP/hgrc:2: ui.debug=true |
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
103 |
$TESTTMP/hgrc:3: ui.fallbackencoding=ASCII |
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
104 |
$TESTTMP/hgrc:4: ui.quiet=true |
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
105 |
$TESTTMP/hgrc:5: ui.slash=true |
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
106 |
$TESTTMP/hgrc:6: ui.traceback=true |
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
107 |
$TESTTMP/hgrc:7: ui.verbose=true |
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
108 |
$TESTTMP/hgrc:8: ui.style=~/.hgstyle |
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
109 |
$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
|
110 |
|
12014 | 111 |
plain hgrc |
112 |
||
113 |
$ HGPLAIN=; export HGPLAIN |
|
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12109
diff
changeset
|
114 |
$ hg showconfig --config ui.traceback=True --debug |
12640
6cc4b14fb76b
tests: remove redundant globs
Mads Kiilerich <mads@kiilerich.com>
parents:
12399
diff
changeset
|
115 |
read config from: $TESTTMP/hgrc |
12014 | 116 |
none: ui.traceback=True |
117 |
none: ui.verbose=False |
|
118 |
none: ui.debug=True |
|
119 |
none: ui.quiet=False |