Show More
@@ -1,97 +1,97 b'' | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | mkdir t |
|
4 | 4 | cd t |
|
5 | 5 | hg init |
|
6 | 6 | echo import > port |
|
7 | 7 | hg add port |
|
8 | 8 | hg commit -m 0 -u spam -d '0 0' |
|
9 | 9 | echo export >> port |
|
10 | 10 | hg commit -m 1 -u eggs -d '1 0' |
|
11 | 11 | echo export > port |
|
12 | 12 | echo vaportight >> port |
|
13 | 13 | echo 'import/export' >> port |
|
14 | 14 | hg commit -m 2 -u spam -d '2 0' |
|
15 | 15 | echo 'import/export' >> port |
|
16 | 16 | hg commit -m 3 -u eggs -d '3 0' |
|
17 | 17 | head -n 3 port > port1 |
|
18 | 18 | mv port1 port |
|
19 | 19 | hg commit -m 4 -u spam -d '4 0' |
|
20 | 20 | echo % pattern error |
|
21 | 21 | hg grep '**test**' |
|
22 | 22 | echo % simple |
|
23 | 23 | hg grep port port |
|
24 | 24 | echo % all |
|
25 | 25 | hg grep --all -nu port port |
|
26 | 26 | echo % other |
|
27 | 27 | hg grep import port |
|
28 | 28 | |
|
29 | 29 | hg cp port port2 |
|
30 | 30 | hg commit -m 4 -u spam -d '5 0' |
|
31 | 31 | echo '% follow' |
|
32 | 32 | hg grep -f 'import$' port2 |
|
33 | 33 | echo deport >> port2 |
|
34 | 34 | hg commit -m 5 -u eggs -d '6 0' |
|
35 | 35 | hg grep -f --all -nu port port2 |
|
36 | 36 | |
|
37 | 37 | cd .. |
|
38 | 38 | hg init t2 |
|
39 | 39 | cd t2 |
|
40 | 40 | hg grep foobar foo |
|
41 | 41 | hg grep foobar |
|
42 | 42 | echo blue >> color |
|
43 | 43 | echo black >> color |
|
44 | 44 | hg add color |
|
45 | 45 | hg ci -m 0 |
|
46 | 46 | echo orange >> color |
|
47 | 47 | hg ci -m 1 |
|
48 | 48 | echo black > color |
|
49 | 49 | hg ci -m 2 |
|
50 | 50 | echo orange >> color |
|
51 | 51 | echo blue >> color |
|
52 | 52 | hg ci -m 3 |
|
53 | 53 | hg grep orange |
|
54 | 54 | hg grep --all orange |
|
55 | 55 | |
|
56 | 56 | echo % match in last "line" without newline |
|
57 | 57 | python -c 'fp = open("noeol", "wb"); fp.write("no infinite loop"); fp.close();' |
|
58 | 58 | hg ci -Amnoeol |
|
59 | 59 | echo % last character omitted in output to avoid infinite loop |
|
60 | 60 | hg grep loop |
|
61 | 61 | |
|
62 | 62 | # Got a traceback when using grep on a single |
|
63 | 63 | # revision with renamed files. |
|
64 | 64 | cd .. |
|
65 | 65 | echo % issue 685 |
|
66 | 66 | hg init issue685 |
|
67 | 67 | cd issue685 |
|
68 | 68 | echo octarine > color |
|
69 | 69 | hg ci -Amcolor |
|
70 | 70 | hg rename color colour |
|
71 | 71 | hg ci -Am rename |
|
72 | 72 | hg grep octarine |
|
73 | 73 | # Used to crash here |
|
74 | 74 | hg grep -r 1 octarine |
|
75 | 75 | |
|
76 | # Issue337: grep did not compared changesets by their revision numbers | |
|
77 | # instead of following parent-child relationships. | |
|
76 | # Issue337: test that grep follows parent-child relationships instead | |
|
77 | # of just using revision numbers. | |
|
78 | 78 | cd .. |
|
79 | 79 | echo % issue 337 |
|
80 | 80 | hg init issue337 |
|
81 | 81 | cd issue337 |
|
82 | 82 | |
|
83 | 83 | echo white > color |
|
84 | 84 | hg commit -A -m "0 white" |
|
85 | 85 | |
|
86 | 86 | echo red > color |
|
87 | 87 | hg commit -A -m "1 red" |
|
88 | 88 | |
|
89 | 89 | hg update 0 |
|
90 | 90 | echo black > color |
|
91 | 91 | hg commit -A -m "2 black" |
|
92 | 92 | |
|
93 | 93 | hg update --clean 1 |
|
94 | 94 | echo blue > color |
|
95 | 95 | hg commit -A -m "3 blue" |
|
96 | 96 | |
|
97 | 97 | hg grep --all red |
General Comments 0
You need to be logged in to leave comments.
Login now