Mercurial > hg
comparison tests/test-fileset.t @ 38831:b975c5801487
fileset: reorder 'and' expression to evaluate basic patterns first
Timing of a crafted example (when disk cache is warm):
$ hg files set:'binary() and path:contrib'
(orig) time: real 0.140 secs (user 0.120+0.000 sys 0.020+0.000)
(new) time: real 0.040 secs (user 0.030+0.000 sys 0.010+0.000)
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 21 Jul 2018 16:41:45 +0900 |
parents | 7e7e2b2ff284 |
children | ca4de8ba5b5f |
comparison
equal
deleted
inserted
replaced
38830:bfd5def3fe02 | 38831:b975c5801487 |
---|---|
184 (or | 184 (or |
185 (symbol 'a1') | 185 (symbol 'a1') |
186 (symbol 'a2') | 186 (symbol 'a2') |
187 (and | 187 (and |
188 (func | 188 (func |
189 (symbol 'clean') | |
190 None) | |
191 (func | |
189 (symbol 'grep') | 192 (symbol 'grep') |
190 (string 'b')) | 193 (string 'b')))) |
191 (func | |
192 (symbol 'clean') | |
193 None))) | |
194 * matcher: | 194 * matcher: |
195 <unionmatcher matchers=[ | 195 <unionmatcher matchers=[ |
196 <patternmatcher patterns='(?:a1$)'>, | 196 <patternmatcher patterns='(?:a1$)'>, |
197 <patternmatcher patterns='(?:a2$)'>, | 197 <patternmatcher patterns='(?:a2$)'>, |
198 <intersectionmatcher | 198 <intersectionmatcher |
199 m1=<predicatenmatcher pred=grep('b')>, | 199 m1=<predicatenmatcher pred=clean>, |
200 m2=<predicatenmatcher pred=clean>>]> | 200 m2=<predicatenmatcher pred=grep('b')>>]> |
201 a1 | 201 a1 |
202 a2 | 202 a2 |
203 b1 | 203 b1 |
204 b2 | 204 b2 |
205 | 205 |
279 $ echo '^bin$' >> .hgignore | 279 $ echo '^bin$' >> .hgignore |
280 $ fileset 'binary() and ignored()' | 280 $ fileset 'binary() and ignored()' |
281 bin | 281 bin |
282 $ hg add bin | 282 $ hg add bin |
283 $ fileset 'binary()' | 283 $ fileset 'binary()' |
284 bin | |
285 | |
286 $ fileset -p optimized -s 'binary() and b*' | |
287 * optimized: | |
288 (and | |
289 (symbol 'b*') | |
290 (func | |
291 (symbol 'binary') | |
292 None)) | |
293 * matcher: | |
294 <intersectionmatcher | |
295 m1=<patternmatcher patterns='(?:b[^/]*$)'>, | |
296 m2=<predicatenmatcher pred=binary>> | |
284 bin | 297 bin |
285 | 298 |
286 $ fileset 'grep("b{1}")' | 299 $ fileset 'grep("b{1}")' |
287 .hgignore | 300 .hgignore |
288 b1 | 301 b1 |