##// END OF EJS Templates
test 261a9f47b44b: grep w/ match in last line w/o newline...
Christian Ebert -
r7240:dac14cc9 default
parent child Browse files
Show More
@@ -1,68 +1,75 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 -d '0 0'
45 hg ci -m 0 -d '0 0'
46 echo orange >> color
46 echo orange >> color
47 hg ci -m 1 -d '0 0'
47 hg ci -m 1 -d '0 0'
48 echo black > color
48 echo black > color
49 hg ci -m 2 -d '0 0'
49 hg ci -m 2 -d '0 0'
50 echo orange >> color
50 echo orange >> color
51 echo blue >> color
51 echo blue >> color
52 hg ci -m 3 -d '0 0'
52 hg ci -m 3 -d '0 0'
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
57 python -c 'fp = open("noeol", "wb"); fp.write("no infinite loop"); fp.close();'
58 hg ci -Amnoeol
59 echo % last character omitted in output to avoid infinite loop
60 hg grep loop
61
56 # Got a traceback when using grep on a single
62 # Got a traceback when using grep on a single
57 # revision with renamed files.
63 # revision with renamed files.
58 cd ..
64 cd ..
59 echo % issue 685
65 echo % issue 685
60 hg init issue685
66 hg init issue685
61 cd issue685
67 cd issue685
62 echo octarine > color
68 echo octarine > color
63 hg ci -Amcolor
69 hg ci -Amcolor
64 hg rename color colour
70 hg rename color colour
65 hg ci -Am rename
71 hg ci -Am rename
66 hg grep octarine
72 hg grep octarine
67 # Used to crash here
73 # Used to crash here
68 hg grep -r 1 octarine
74 hg grep -r 1 octarine
75
@@ -1,39 +1,43 b''
1 % pattern error
1 % pattern error
2 grep: invalid match pattern: nothing to repeat
2 grep: invalid match pattern: nothing to repeat
3 % simple
3 % simple
4 port:4:export
4 port:4:export
5 port:4:vaportight
5 port:4:vaportight
6 port:4:import/export
6 port:4:import/export
7 % all
7 % all
8 port:4:4:-:spam:import/export
8 port:4:4:-:spam:import/export
9 port:3:4:+:eggs:import/export
9 port:3:4:+:eggs:import/export
10 port:2:1:-:spam:import
10 port:2:1:-:spam:import
11 port:2:2:-:spam:export
11 port:2:2:-:spam:export
12 port:2:1:+:spam:export
12 port:2:1:+:spam:export
13 port:2:2:+:spam:vaportight
13 port:2:2:+:spam:vaportight
14 port:2:3:+:spam:import/export
14 port:2:3:+:spam:import/export
15 port:1:2:+:eggs:export
15 port:1:2:+:eggs:export
16 port:0:1:+:spam:import
16 port:0:1:+:spam:import
17 % other
17 % other
18 port:4:import/export
18 port:4:import/export
19 % follow
19 % follow
20 port:0:import
20 port:0:import
21 port2:6:4:+:eggs:deport
21 port2:6:4:+:eggs:deport
22 port:4:4:-:spam:import/export
22 port:4:4:-:spam:import/export
23 port:3:4:+:eggs:import/export
23 port:3:4:+:eggs:import/export
24 port:2:1:-:spam:import
24 port:2:1:-:spam:import
25 port:2:2:-:spam:export
25 port:2:2:-:spam:export
26 port:2:1:+:spam:export
26 port:2:1:+:spam:export
27 port:2:2:+:spam:vaportight
27 port:2:2:+:spam:vaportight
28 port:2:3:+:spam:import/export
28 port:2:3:+:spam:import/export
29 port:1:2:+:eggs:export
29 port:1:2:+:eggs:export
30 port:0:1:+:spam:import
30 port:0:1:+:spam:import
31 color:3:orange
31 color:3:orange
32 color:3:+:orange
32 color:3:+:orange
33 color:2:-:orange
33 color:2:-:orange
34 color:1:+:orange
34 color:1:+:orange
35 % match in last line without newline
36 adding noeol
37 % last character omitted in output to avoid infinite loop
38 noeol:4:no infinite loo
35 % issue 685
39 % issue 685
36 adding color
40 adding color
37 color:0:octarine
41 color:0:octarine
38 colour:1:octarine
42 colour:1:octarine
39 colour:1:octarine
43 colour:1:octarine
General Comments 0
You need to be logged in to leave comments. Login now