Mercurial > hg
annotate tests/test-grep @ 10930:230ab9a23594
wix updates
- using FileSource attribute
- removed unneeded "DiskId='1'"
- all guids are now in guids.wxi
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Fri, 16 Apr 2010 14:57:30 +0200 |
parents | 717c35d55fb3 |
children | df5d1d571d27 |
rev | line source |
---|---|
1146
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
1 #!/bin/sh |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
2 |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
3 mkdir t |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
4 cd t |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
5 hg init |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
6 echo import > port |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
7 hg add port |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
8 hg commit -m 0 -u spam -d '0 0' |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
9 echo export >> port |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
10 hg commit -m 1 -u eggs -d '1 0' |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
11 echo export > port |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
12 echo vaportight >> port |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
13 echo 'import/export' >> port |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
14 hg commit -m 2 -u spam -d '2 0' |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
15 echo 'import/export' >> port |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
16 hg commit -m 3 -u eggs -d '3 0' |
1539
5e47e42b14ba
use posix compliant option for head
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1212
diff
changeset
|
17 head -n 3 port > port1 |
1146
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
18 mv port1 port |
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
19 hg commit -m 4 -u spam -d '4 0' |
4877
242026115e6a
hg grep: handle re.compile errors & update tests/test-grep
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3951
diff
changeset
|
20 echo % pattern error |
242026115e6a
hg grep: handle re.compile errors & update tests/test-grep
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
3951
diff
changeset
|
21 hg grep '**test**' |
3950
3d3007064a17
grep: incrementing is always False during 'iter'
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
2870
diff
changeset
|
22 echo % simple |
1146
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
23 hg grep port port |
10826
717c35d55fb3
color: colorize based on output labels instead of parsing output
Brodie Rao <brodie@bitheap.org>
parents:
9367
diff
changeset
|
24 echo % simple with color |
717c35d55fb3
color: colorize based on output labels instead of parsing output
Brodie Rao <brodie@bitheap.org>
parents:
9367
diff
changeset
|
25 hg --config extensions.color= grep --color=always port port |
3950
3d3007064a17
grep: incrementing is always False during 'iter'
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
2870
diff
changeset
|
26 echo % all |
9367
1ef630452e0b
cmdutil: use context objects for walkchangerevs()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8897
diff
changeset
|
27 hg grep --traceback --all -nu port port |
3950
3d3007064a17
grep: incrementing is always False during 'iter'
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
2870
diff
changeset
|
28 echo % other |
1146
9061f79c6c6f
grep: extend functionality, add man page entry, add unit test.
bos@serpentine.internal.keyresearch.com
parents:
diff
changeset
|
29 hg grep import port |
2870
8eaaf1321bfe
grep: add --follow support.
Brendan Cully <brendan@kublai.com>
parents:
2869
diff
changeset
|
30 |
8eaaf1321bfe
grep: add --follow support.
Brendan Cully <brendan@kublai.com>
parents:
2869
diff
changeset
|
31 hg cp port port2 |
8eaaf1321bfe
grep: add --follow support.
Brendan Cully <brendan@kublai.com>
parents:
2869
diff
changeset
|
32 hg commit -m 4 -u spam -d '5 0' |
9367
1ef630452e0b
cmdutil: use context objects for walkchangerevs()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8897
diff
changeset
|
33 echo % follow |
1ef630452e0b
cmdutil: use context objects for walkchangerevs()
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8897
diff
changeset
|
34 hg grep --traceback -f 'import$' port2 |
2870
8eaaf1321bfe
grep: add --follow support.
Brendan Cully <brendan@kublai.com>
parents:
2869
diff
changeset
|
35 echo deport >> port2 |
8eaaf1321bfe
grep: add --follow support.
Brendan Cully <brendan@kublai.com>
parents:
2869
diff
changeset
|
36 hg commit -m 5 -u eggs -d '6 0' |
8eaaf1321bfe
grep: add --follow support.
Brendan Cully <brendan@kublai.com>
parents:
2869
diff
changeset
|
37 hg grep -f --all -nu port port2 |
3951
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
38 |
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
39 cd .. |
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
40 hg init t2 |
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
41 cd t2 |
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
42 hg grep foobar foo |
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
43 hg grep foobar |
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
44 echo blue >> color |
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
45 echo black >> color |
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
46 hg add color |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
7240
diff
changeset
|
47 hg ci -m 0 |
3951
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
48 echo orange >> color |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
7240
diff
changeset
|
49 hg ci -m 1 |
3951
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
50 echo black > color |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
7240
diff
changeset
|
51 hg ci -m 2 |
3951
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
52 echo orange >> color |
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
53 echo blue >> color |
8167
6c82beaaa11a
tests: removed redundant "-d '0 0'" from test scripts
Martin Geisler <mg@lazybytes.net>
parents:
7240
diff
changeset
|
54 hg ci -m 3 |
3951
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
55 hg grep orange |
cb66641cdee3
grep: remove count handling, simplify, fix issue337
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3950
diff
changeset
|
56 hg grep --all orange |
5106
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
57 |
7240
dac14cc9711e
test 261a9f47b44b: grep w/ match in last line w/o newline
Christian Ebert <blacktrash@gmx.net>
parents:
5107
diff
changeset
|
58 echo % match in last "line" without newline |
dac14cc9711e
test 261a9f47b44b: grep w/ match in last line w/o newline
Christian Ebert <blacktrash@gmx.net>
parents:
5107
diff
changeset
|
59 python -c 'fp = open("noeol", "wb"); fp.write("no infinite loop"); fp.close();' |
dac14cc9711e
test 261a9f47b44b: grep w/ match in last line w/o newline
Christian Ebert <blacktrash@gmx.net>
parents:
5107
diff
changeset
|
60 hg ci -Amnoeol |
dac14cc9711e
test 261a9f47b44b: grep w/ match in last line w/o newline
Christian Ebert <blacktrash@gmx.net>
parents:
5107
diff
changeset
|
61 echo % last character omitted in output to avoid infinite loop |
dac14cc9711e
test 261a9f47b44b: grep w/ match in last line w/o newline
Christian Ebert <blacktrash@gmx.net>
parents:
5107
diff
changeset
|
62 hg grep loop |
dac14cc9711e
test 261a9f47b44b: grep w/ match in last line w/o newline
Christian Ebert <blacktrash@gmx.net>
parents:
5107
diff
changeset
|
63 |
5106
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
64 # Got a traceback when using grep on a single |
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
65 # revision with renamed files. |
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
66 cd .. |
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
67 echo % issue 685 |
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
68 hg init issue685 |
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
69 cd issue685 |
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
70 echo octarine > color |
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
71 hg ci -Amcolor |
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
72 hg rename color colour |
5107
0edea751bbb2
test-grep: use lowercase hg command
Matt Mackall <mpm@selenic.com>
parents:
5106
diff
changeset
|
73 hg ci -Am rename |
5106
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
74 hg grep octarine |
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
75 # Used to crash here |
ee702e7f181f
test-grep: test issue 685
Patrick Mezard <pmezard@gmail.com>
parents:
4877
diff
changeset
|
76 hg grep -r 1 octarine |
7240
dac14cc9711e
test 261a9f47b44b: grep w/ match in last line w/o newline
Christian Ebert <blacktrash@gmx.net>
parents:
5107
diff
changeset
|
77 |
8897
aa78a0583731
test-grep: fixed comment
Martin Geisler <mg@lazybytes.net>
parents:
8849
diff
changeset
|
78 # Issue337: test that grep follows parent-child relationships instead |
aa78a0583731
test-grep: fixed comment
Martin Geisler <mg@lazybytes.net>
parents:
8849
diff
changeset
|
79 # of just using revision numbers. |
8849
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
80 cd .. |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
81 echo % issue 337 |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
82 hg init issue337 |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
83 cd issue337 |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
84 |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
85 echo white > color |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
86 hg commit -A -m "0 white" |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
87 |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
88 echo red > color |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
89 hg commit -A -m "1 red" |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
90 |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
91 hg update 0 |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
92 echo black > color |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
93 hg commit -A -m "2 black" |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
94 |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
95 hg update --clean 1 |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
96 echo blue > color |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
97 hg commit -A -m "3 blue" |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
98 |
80cc4b1a62d0
compare grep result between target and its parent
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
8167
diff
changeset
|
99 hg grep --all red |