Show More
@@ -1,343 +1,343 b'' | |||||
1 | $ hg init t |
|
1 | $ hg init t | |
2 | $ cd t |
|
2 | $ cd t | |
3 | $ echo import > port |
|
3 | $ echo import > port | |
4 | $ hg add port |
|
4 | $ hg add port | |
5 | $ hg commit -m 0 -u spam -d '0 0' |
|
5 | $ hg commit -m 0 -u spam -d '0 0' | |
6 | $ echo export >> port |
|
6 | $ echo export >> port | |
7 | $ hg commit -m 1 -u eggs -d '1 0' |
|
7 | $ hg commit -m 1 -u eggs -d '1 0' | |
8 | $ echo export > port |
|
8 | $ echo export > port | |
9 | $ echo vaportight >> port |
|
9 | $ echo vaportight >> port | |
10 | $ echo 'import/export' >> port |
|
10 | $ echo 'import/export' >> port | |
11 | $ hg commit -m 2 -u spam -d '2 0' |
|
11 | $ hg commit -m 2 -u spam -d '2 0' | |
12 | $ echo 'import/export' >> port |
|
12 | $ echo 'import/export' >> port | |
13 | $ hg commit -m 3 -u eggs -d '3 0' |
|
13 | $ hg commit -m 3 -u eggs -d '3 0' | |
14 | $ head -n 3 port > port1 |
|
14 | $ head -n 3 port > port1 | |
15 | $ mv port1 port |
|
15 | $ mv port1 port | |
16 | $ hg commit -m 4 -u spam -d '4 0' |
|
16 | $ hg commit -m 4 -u spam -d '4 0' | |
17 |
|
17 | |||
18 | pattern error |
|
18 | pattern error | |
19 |
|
19 | |||
20 | $ hg grep '**test**' |
|
20 | $ hg grep '**test**' | |
21 | grep: invalid match pattern: nothing to repeat |
|
21 | grep: invalid match pattern: nothing to repeat | |
22 | [1] |
|
22 | [1] | |
23 |
|
23 | |||
24 | simple |
|
24 | simple | |
25 |
|
25 | |||
26 | $ hg grep '.*' |
|
26 | $ hg grep '.*' | |
27 | port:4:export |
|
27 | port:4:export | |
28 | port:4:vaportight |
|
28 | port:4:vaportight | |
29 | port:4:import/export |
|
29 | port:4:import/export | |
30 | $ hg grep port port |
|
30 | $ hg grep port port | |
31 | port:4:export |
|
31 | port:4:export | |
32 | port:4:vaportight |
|
32 | port:4:vaportight | |
33 | port:4:import/export |
|
33 | port:4:import/export | |
34 |
|
34 | |||
35 | simple with color |
|
35 | simple with color | |
36 |
|
36 | |||
37 | $ hg --config extensions.color= grep --config color.mode=ansi \ |
|
37 | $ hg --config extensions.color= grep --config color.mode=ansi \ | |
38 | > --color=always port port |
|
38 | > --color=always port port | |
39 | \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mex\x1b[0;31;1mport\x1b[0m (esc) |
|
39 | \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mex\x1b[0;31;1mport\x1b[0m (esc) | |
40 | \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mva\x1b[0;31;1mport\x1b[0might (esc) |
|
40 | \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mva\x1b[0;31;1mport\x1b[0might (esc) | |
41 | \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m/ex\x1b[0;31;1mport\x1b[0m (esc) |
|
41 | \x1b[0;35mport\x1b[0m\x1b[0;36m:\x1b[0m\x1b[0;32m4\x1b[0m\x1b[0;36m:\x1b[0mim\x1b[0;31;1mport\x1b[0m/ex\x1b[0;31;1mport\x1b[0m (esc) | |
42 |
|
42 | |||
43 | simple templated |
|
43 | simple templated | |
44 |
|
44 | |||
45 | $ hg grep port \ |
|
45 | $ hg grep port \ | |
46 | > -T '{file}:{rev}:{node|short}:{texts % "{if(matched, text|upper, text)}"}\n' |
|
46 | > -T '{file}:{rev}:{node|short}:{texts % "{if(matched, text|upper, text)}"}\n' | |
47 | port:4:914fa752cdea:exPORT |
|
47 | port:4:914fa752cdea:exPORT | |
48 | port:4:914fa752cdea:vaPORTight |
|
48 | port:4:914fa752cdea:vaPORTight | |
49 | port:4:914fa752cdea:imPORT/exPORT |
|
49 | port:4:914fa752cdea:imPORT/exPORT | |
50 |
|
50 | |||
51 | simple JSON (no "change" field) |
|
51 | simple JSON (no "change" field) | |
52 |
|
52 | |||
53 | $ hg grep -Tjson port |
|
53 | $ hg grep -Tjson port | |
54 | [ |
|
54 | [ | |
55 | { |
|
55 | { | |
56 | "date": [4.0, 0], |
|
56 | "date": [4.0, 0], | |
57 | "file": "port", |
|
57 | "file": "port", | |
58 | "line_number": 1, |
|
58 | "line_number": 1, | |
59 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", |
|
59 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", | |
60 | "rev": 4, |
|
60 | "rev": 4, | |
61 | "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], |
|
61 | "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], | |
62 | "user": "spam" |
|
62 | "user": "spam" | |
63 | }, |
|
63 | }, | |
64 | { |
|
64 | { | |
65 | "date": [4.0, 0], |
|
65 | "date": [4.0, 0], | |
66 | "file": "port", |
|
66 | "file": "port", | |
67 | "line_number": 2, |
|
67 | "line_number": 2, | |
68 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", |
|
68 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", | |
69 | "rev": 4, |
|
69 | "rev": 4, | |
70 | "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}], |
|
70 | "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}], | |
71 | "user": "spam" |
|
71 | "user": "spam" | |
72 | }, |
|
72 | }, | |
73 | { |
|
73 | { | |
74 | "date": [4.0, 0], |
|
74 | "date": [4.0, 0], | |
75 | "file": "port", |
|
75 | "file": "port", | |
76 | "line_number": 3, |
|
76 | "line_number": 3, | |
77 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", |
|
77 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", | |
78 | "rev": 4, |
|
78 | "rev": 4, | |
79 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], |
|
79 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], | |
80 | "user": "spam" |
|
80 | "user": "spam" | |
81 | } |
|
81 | } | |
82 | ] |
|
82 | ] | |
83 |
|
83 | |||
84 | simple JSON without matching lines |
|
84 | simple JSON without matching lines | |
85 |
|
85 | |||
86 | $ hg grep -Tjson -l port |
|
86 | $ hg grep -Tjson -l port | |
87 | [ |
|
87 | [ | |
88 | { |
|
88 | { | |
89 | "date": [4.0, 0], |
|
89 | "date": [4.0, 0], | |
90 | "file": "port", |
|
90 | "file": "port", | |
91 | "line_number": 1, |
|
91 | "line_number": 1, | |
92 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", |
|
92 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", | |
93 | "rev": 4, |
|
93 | "rev": 4, | |
94 | "user": "spam" |
|
94 | "user": "spam" | |
95 | } |
|
95 | } | |
96 | ] |
|
96 | ] | |
97 |
|
97 | |||
98 | all |
|
98 | all | |
99 |
|
99 | |||
100 | $ hg grep --traceback --all -nu port port |
|
100 | $ hg grep --traceback --all -nu port port | |
101 | port:4:4:-:spam:import/export |
|
101 | port:4:4:-:spam:import/export | |
102 | port:3:4:+:eggs:import/export |
|
102 | port:3:4:+:eggs:import/export | |
103 | port:2:1:-:spam:import |
|
103 | port:2:1:-:spam:import | |
104 | port:2:2:-:spam:export |
|
104 | port:2:2:-:spam:export | |
105 | port:2:1:+:spam:export |
|
105 | port:2:1:+:spam:export | |
106 | port:2:2:+:spam:vaportight |
|
106 | port:2:2:+:spam:vaportight | |
107 | port:2:3:+:spam:import/export |
|
107 | port:2:3:+:spam:import/export | |
108 | port:1:2:+:eggs:export |
|
108 | port:1:2:+:eggs:export | |
109 | port:0:1:+:spam:import |
|
109 | port:0:1:+:spam:import | |
110 |
|
110 | |||
111 | all JSON |
|
111 | all JSON | |
112 |
|
112 | |||
113 | $ hg grep --all -Tjson port port |
|
113 | $ hg grep --all -Tjson port port | |
114 | [ |
|
114 | [ | |
115 | { |
|
115 | { | |
116 | "change": "-", |
|
116 | "change": "-", | |
117 | "date": [4.0, 0], |
|
117 | "date": [4.0, 0], | |
118 | "file": "port", |
|
118 | "file": "port", | |
119 | "line_number": 4, |
|
119 | "line_number": 4, | |
120 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", |
|
120 | "node": "914fa752cdea87777ac1a8d5c858b0c736218f6c", | |
121 | "rev": 4, |
|
121 | "rev": 4, | |
122 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], |
|
122 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], | |
123 | "user": "spam" |
|
123 | "user": "spam" | |
124 | }, |
|
124 | }, | |
125 | { |
|
125 | { | |
126 | "change": "+", |
|
126 | "change": "+", | |
127 | "date": [3.0, 0], |
|
127 | "date": [3.0, 0], | |
128 | "file": "port", |
|
128 | "file": "port", | |
129 | "line_number": 4, |
|
129 | "line_number": 4, | |
130 | "node": "95040cfd017d658c536071c6290230a613c4c2a6", |
|
130 | "node": "95040cfd017d658c536071c6290230a613c4c2a6", | |
131 | "rev": 3, |
|
131 | "rev": 3, | |
132 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], |
|
132 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], | |
133 | "user": "eggs" |
|
133 | "user": "eggs" | |
134 | }, |
|
134 | }, | |
135 | { |
|
135 | { | |
136 | "change": "-", |
|
136 | "change": "-", | |
137 | "date": [2.0, 0], |
|
137 | "date": [2.0, 0], | |
138 | "file": "port", |
|
138 | "file": "port", | |
139 | "line_number": 1, |
|
139 | "line_number": 1, | |
140 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", |
|
140 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", | |
141 | "rev": 2, |
|
141 | "rev": 2, | |
142 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}], |
|
142 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}], | |
143 | "user": "spam" |
|
143 | "user": "spam" | |
144 | }, |
|
144 | }, | |
145 | { |
|
145 | { | |
146 | "change": "-", |
|
146 | "change": "-", | |
147 | "date": [2.0, 0], |
|
147 | "date": [2.0, 0], | |
148 | "file": "port", |
|
148 | "file": "port", | |
149 | "line_number": 2, |
|
149 | "line_number": 2, | |
150 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", |
|
150 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", | |
151 | "rev": 2, |
|
151 | "rev": 2, | |
152 | "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], |
|
152 | "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], | |
153 | "user": "spam" |
|
153 | "user": "spam" | |
154 | }, |
|
154 | }, | |
155 | { |
|
155 | { | |
156 | "change": "+", |
|
156 | "change": "+", | |
157 | "date": [2.0, 0], |
|
157 | "date": [2.0, 0], | |
158 | "file": "port", |
|
158 | "file": "port", | |
159 | "line_number": 1, |
|
159 | "line_number": 1, | |
160 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", |
|
160 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", | |
161 | "rev": 2, |
|
161 | "rev": 2, | |
162 | "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], |
|
162 | "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], | |
163 | "user": "spam" |
|
163 | "user": "spam" | |
164 | }, |
|
164 | }, | |
165 | { |
|
165 | { | |
166 | "change": "+", |
|
166 | "change": "+", | |
167 | "date": [2.0, 0], |
|
167 | "date": [2.0, 0], | |
168 | "file": "port", |
|
168 | "file": "port", | |
169 | "line_number": 2, |
|
169 | "line_number": 2, | |
170 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", |
|
170 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", | |
171 | "rev": 2, |
|
171 | "rev": 2, | |
172 | "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}], |
|
172 | "texts": [{"matched": false, "text": "va"}, {"matched": true, "text": "port"}, {"matched": false, "text": "ight"}], | |
173 | "user": "spam" |
|
173 | "user": "spam" | |
174 | }, |
|
174 | }, | |
175 | { |
|
175 | { | |
176 | "change": "+", |
|
176 | "change": "+", | |
177 | "date": [2.0, 0], |
|
177 | "date": [2.0, 0], | |
178 | "file": "port", |
|
178 | "file": "port", | |
179 | "line_number": 3, |
|
179 | "line_number": 3, | |
180 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", |
|
180 | "node": "3b325e3481a1f07435d81dfdbfa434d9a0245b47", | |
181 | "rev": 2, |
|
181 | "rev": 2, | |
182 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], |
|
182 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}, {"matched": false, "text": "/ex"}, {"matched": true, "text": "port"}], | |
183 | "user": "spam" |
|
183 | "user": "spam" | |
184 | }, |
|
184 | }, | |
185 | { |
|
185 | { | |
186 | "change": "+", |
|
186 | "change": "+", | |
187 | "date": [1.0, 0], |
|
187 | "date": [1.0, 0], | |
188 | "file": "port", |
|
188 | "file": "port", | |
189 | "line_number": 2, |
|
189 | "line_number": 2, | |
190 | "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587", |
|
190 | "node": "8b20f75c158513ff5ac80bd0e5219bfb6f0eb587", | |
191 | "rev": 1, |
|
191 | "rev": 1, | |
192 | "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], |
|
192 | "texts": [{"matched": false, "text": "ex"}, {"matched": true, "text": "port"}], | |
193 | "user": "eggs" |
|
193 | "user": "eggs" | |
194 | }, |
|
194 | }, | |
195 | { |
|
195 | { | |
196 | "change": "+", |
|
196 | "change": "+", | |
197 | "date": [0.0, 0], |
|
197 | "date": [0.0, 0], | |
198 | "file": "port", |
|
198 | "file": "port", | |
199 | "line_number": 1, |
|
199 | "line_number": 1, | |
200 | "node": "f31323c9217050ba245ee8b537c713ec2e8ab226", |
|
200 | "node": "f31323c9217050ba245ee8b537c713ec2e8ab226", | |
201 | "rev": 0, |
|
201 | "rev": 0, | |
202 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}], |
|
202 | "texts": [{"matched": false, "text": "im"}, {"matched": true, "text": "port"}], | |
203 | "user": "spam" |
|
203 | "user": "spam" | |
204 | } |
|
204 | } | |
205 | ] |
|
205 | ] | |
206 |
|
206 | |||
207 | other |
|
207 | other | |
208 |
|
208 | |||
209 | $ hg grep -l port port |
|
209 | $ hg grep -l port port | |
210 | port:4 |
|
210 | port:4 | |
211 | $ hg grep import port |
|
211 | $ hg grep import port | |
212 | port:4:import/export |
|
212 | port:4:import/export | |
213 |
|
213 | |||
214 | $ hg cp port port2 |
|
214 | $ hg cp port port2 | |
215 | $ hg commit -m 4 -u spam -d '5 0' |
|
215 | $ hg commit -m 4 -u spam -d '5 0' | |
216 |
|
216 | |||
217 | follow |
|
217 | follow | |
218 |
|
218 | |||
219 | $ hg grep --traceback -f 'import\n\Z' port2 |
|
219 | $ hg grep --traceback -f 'import\n\Z' port2 | |
220 | port:0:import |
|
220 | port:0:import | |
221 |
|
221 | |||
222 | $ echo deport >> port2 |
|
222 | $ echo deport >> port2 | |
223 | $ hg commit -m 5 -u eggs -d '6 0' |
|
223 | $ hg commit -m 5 -u eggs -d '6 0' | |
224 | $ hg grep -f --all -nu port port2 |
|
224 | $ hg grep -f --all -nu port port2 | |
225 | port2:6:4:+:eggs:deport |
|
225 | port2:6:4:+:eggs:deport | |
226 | port:4:4:-:spam:import/export |
|
226 | port:4:4:-:spam:import/export | |
227 | port:3:4:+:eggs:import/export |
|
227 | port:3:4:+:eggs:import/export | |
228 | port:2:1:-:spam:import |
|
228 | port:2:1:-:spam:import | |
229 | port:2:2:-:spam:export |
|
229 | port:2:2:-:spam:export | |
230 | port:2:1:+:spam:export |
|
230 | port:2:1:+:spam:export | |
231 | port:2:2:+:spam:vaportight |
|
231 | port:2:2:+:spam:vaportight | |
232 | port:2:3:+:spam:import/export |
|
232 | port:2:3:+:spam:import/export | |
233 | port:1:2:+:eggs:export |
|
233 | port:1:2:+:eggs:export | |
234 | port:0:1:+:spam:import |
|
234 | port:0:1:+:spam:import | |
235 |
|
235 | |||
236 | $ hg up -q null |
|
236 | $ hg up -q null | |
237 | $ hg grep -f port |
|
237 | $ hg grep -f port | |
238 | [1] |
|
238 | [1] | |
239 |
|
239 | |||
240 | $ cd .. |
|
240 | $ cd .. | |
241 | $ hg init t2 |
|
241 | $ hg init t2 | |
242 | $ cd t2 |
|
242 | $ cd t2 | |
243 | $ hg grep foobar foo |
|
243 | $ hg grep foobar foo | |
244 | [1] |
|
244 | [1] | |
245 | $ hg grep foobar |
|
245 | $ hg grep foobar | |
246 | [1] |
|
246 | [1] | |
247 | $ echo blue >> color |
|
247 | $ echo blue >> color | |
248 | $ echo black >> color |
|
248 | $ echo black >> color | |
249 | $ hg add color |
|
249 | $ hg add color | |
250 | $ hg ci -m 0 |
|
250 | $ hg ci -m 0 | |
251 | $ echo orange >> color |
|
251 | $ echo orange >> color | |
252 | $ hg ci -m 1 |
|
252 | $ hg ci -m 1 | |
253 | $ echo black > color |
|
253 | $ echo black > color | |
254 | $ hg ci -m 2 |
|
254 | $ hg ci -m 2 | |
255 | $ echo orange >> color |
|
255 | $ echo orange >> color | |
256 | $ echo blue >> color |
|
256 | $ echo blue >> color | |
257 | $ hg ci -m 3 |
|
257 | $ hg ci -m 3 | |
258 | $ hg grep orange |
|
258 | $ hg grep orange | |
259 | color:3:orange |
|
259 | color:3:orange | |
260 | $ hg grep --all orange |
|
260 | $ hg grep --all orange | |
261 | color:3:+:orange |
|
261 | color:3:+:orange | |
262 | color:2:-:orange |
|
262 | color:2:-:orange | |
263 | color:1:+:orange |
|
263 | color:1:+:orange | |
264 |
|
264 | |||
265 | test substring match: '^' should only match at the beginning |
|
265 | test substring match: '^' should only match at the beginning | |
266 |
|
266 | |||
267 | $ hg grep '^.' --config extensions.color= --color debug |
|
267 | $ hg grep '^.' --config extensions.color= --color debug | |
268 | [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|b]lack |
|
268 | [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|b]lack | |
269 | [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|o]range |
|
269 | [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|o]range | |
270 | [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|b]lue |
|
270 | [grep.filename|color][grep.sep|:][grep.rev|3][grep.sep|:][grep.match|b]lue | |
271 |
|
271 | |||
272 | match in last "line" without newline |
|
272 | match in last "line" without newline | |
273 |
|
273 | |||
274 | $ $PYTHON -c 'fp = open("noeol", "wb"); fp.write("no infinite loop"); fp.close();' |
|
274 | $ $PYTHON -c 'fp = open("noeol", "wb"); fp.write(b"no infinite loop"); fp.close();' | |
275 | $ hg ci -Amnoeol |
|
275 | $ hg ci -Amnoeol | |
276 | adding noeol |
|
276 | adding noeol | |
277 | $ hg grep loop |
|
277 | $ hg grep loop | |
278 | noeol:4:no infinite loop |
|
278 | noeol:4:no infinite loop | |
279 |
|
279 | |||
280 | $ cd .. |
|
280 | $ cd .. | |
281 |
|
281 | |||
282 | Issue685: traceback in grep -r after rename |
|
282 | Issue685: traceback in grep -r after rename | |
283 |
|
283 | |||
284 | Got a traceback when using grep on a single |
|
284 | Got a traceback when using grep on a single | |
285 | revision with renamed files. |
|
285 | revision with renamed files. | |
286 |
|
286 | |||
287 | $ hg init issue685 |
|
287 | $ hg init issue685 | |
288 | $ cd issue685 |
|
288 | $ cd issue685 | |
289 | $ echo octarine > color |
|
289 | $ echo octarine > color | |
290 | $ hg ci -Amcolor |
|
290 | $ hg ci -Amcolor | |
291 | adding color |
|
291 | adding color | |
292 | $ hg rename color colour |
|
292 | $ hg rename color colour | |
293 | $ hg ci -Am rename |
|
293 | $ hg ci -Am rename | |
294 | $ hg grep octarine |
|
294 | $ hg grep octarine | |
295 | colour:1:octarine |
|
295 | colour:1:octarine | |
296 | color:0:octarine |
|
296 | color:0:octarine | |
297 |
|
297 | |||
298 | Used to crash here |
|
298 | Used to crash here | |
299 |
|
299 | |||
300 | $ hg grep -r 1 octarine |
|
300 | $ hg grep -r 1 octarine | |
301 | colour:1:octarine |
|
301 | colour:1:octarine | |
302 | $ cd .. |
|
302 | $ cd .. | |
303 |
|
303 | |||
304 |
|
304 | |||
305 | Issue337: test that grep follows parent-child relationships instead |
|
305 | Issue337: test that grep follows parent-child relationships instead | |
306 | of just using revision numbers. |
|
306 | of just using revision numbers. | |
307 |
|
307 | |||
308 | $ hg init issue337 |
|
308 | $ hg init issue337 | |
309 | $ cd issue337 |
|
309 | $ cd issue337 | |
310 |
|
310 | |||
311 | $ echo white > color |
|
311 | $ echo white > color | |
312 | $ hg commit -A -m "0 white" |
|
312 | $ hg commit -A -m "0 white" | |
313 | adding color |
|
313 | adding color | |
314 |
|
314 | |||
315 | $ echo red > color |
|
315 | $ echo red > color | |
316 | $ hg commit -A -m "1 red" |
|
316 | $ hg commit -A -m "1 red" | |
317 |
|
317 | |||
318 | $ hg update 0 |
|
318 | $ hg update 0 | |
319 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
319 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
320 | $ echo black > color |
|
320 | $ echo black > color | |
321 | $ hg commit -A -m "2 black" |
|
321 | $ hg commit -A -m "2 black" | |
322 | created new head |
|
322 | created new head | |
323 |
|
323 | |||
324 | $ hg update --clean 1 |
|
324 | $ hg update --clean 1 | |
325 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
325 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
326 | $ echo blue > color |
|
326 | $ echo blue > color | |
327 | $ hg commit -A -m "3 blue" |
|
327 | $ hg commit -A -m "3 blue" | |
328 |
|
328 | |||
329 | $ hg grep --all red |
|
329 | $ hg grep --all red | |
330 | color:3:-:red |
|
330 | color:3:-:red | |
331 | color:1:+:red |
|
331 | color:1:+:red | |
332 |
|
332 | |||
333 | $ cd .. |
|
333 | $ cd .. | |
334 |
|
334 | |||
335 | $ hg init a |
|
335 | $ hg init a | |
336 | $ cd a |
|
336 | $ cd a | |
337 | $ cp "$TESTDIR/binfile.bin" . |
|
337 | $ cp "$TESTDIR/binfile.bin" . | |
338 | $ hg add binfile.bin |
|
338 | $ hg add binfile.bin | |
339 | $ hg ci -m 'add binfile.bin' |
|
339 | $ hg ci -m 'add binfile.bin' | |
340 | $ hg grep "MaCam" --all |
|
340 | $ hg grep "MaCam" --all | |
341 | binfile.bin:0:+: Binary file matches |
|
341 | binfile.bin:0:+: Binary file matches | |
342 |
|
342 | |||
343 | $ cd .. |
|
343 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now