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