Show More
@@ -296,15 +296,17 b' def branch(repo, subset, x):' | |||||
296 | return [r for r in subset if r in s or repo[r].branch() in b] |
|
296 | return [r for r in subset if r in s or repo[r].branch() in b] | |
297 |
|
297 | |||
298 | def checkstatus(repo, subset, pat, field): |
|
298 | def checkstatus(repo, subset, pat, field): | |
299 | m = matchmod.match(repo.root, repo.getcwd(), [pat]) |
|
299 | m = None | |
300 | s = [] |
|
300 | s = [] | |
301 | fast = (m.files() == [pat]) |
|
301 | fast = not matchmod.patkind(pat) | |
302 | for r in subset: |
|
302 | for r in subset: | |
303 | c = repo[r] |
|
303 | c = repo[r] | |
304 | if fast: |
|
304 | if fast: | |
305 | if pat not in c.files(): |
|
305 | if pat not in c.files(): | |
306 | continue |
|
306 | continue | |
307 | else: |
|
307 | else: | |
|
308 | if not m or matchmod.patkind(pat) == 'set': | |||
|
309 | m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=c) | |||
308 | for f in c.files(): |
|
310 | for f in c.files(): | |
309 | if m(f): |
|
311 | if m(f): | |
310 | break |
|
312 | break | |
@@ -354,15 +356,18 b' def contains(repo, subset, x):' | |||||
354 | """ |
|
356 | """ | |
355 | # i18n: "contains" is a keyword |
|
357 | # i18n: "contains" is a keyword | |
356 | pat = getstring(x, _("contains requires a pattern")) |
|
358 | pat = getstring(x, _("contains requires a pattern")) | |
357 | m = matchmod.match(repo.root, repo.getcwd(), [pat]) |
|
359 | m = None | |
358 | s = [] |
|
360 | s = [] | |
359 | if m.files() == [pat]: |
|
361 | if not matchmod.patkind(pat): | |
360 | for r in subset: |
|
362 | for r in subset: | |
361 | if pat in repo[r]: |
|
363 | if pat in repo[r]: | |
362 | s.append(r) |
|
364 | s.append(r) | |
363 | else: |
|
365 | else: | |
364 | for r in subset: |
|
366 | for r in subset: | |
365 |
|
|
367 | c = repo[r] | |
|
368 | if not m or matchmod.patkind(pat) == 'set': | |||
|
369 | m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=c) | |||
|
370 | for f in c.manifest(): | |||
366 | if m(f): |
|
371 | if m(f): | |
367 | s.append(r) |
|
372 | s.append(r) | |
368 | break |
|
373 | break | |
@@ -412,10 +417,11 b' def filelog(repo, subset, x):' | |||||
412 | """ |
|
417 | """ | |
413 |
|
418 | |||
414 | pat = getstring(x, _("filelog requires a pattern")) |
|
419 | pat = getstring(x, _("filelog requires a pattern")) | |
415 |
m = matchmod.match(repo.root, repo.getcwd(), [pat], default='relpath' |
|
420 | m = matchmod.match(repo.root, repo.getcwd(), [pat], default='relpath', | |
|
421 | ctx=repo[None]) | |||
416 | s = set() |
|
422 | s = set() | |
417 |
|
423 | |||
418 |
if not m. |
|
424 | if not matchmod.patkind(pat): | |
419 | for f in m.files(): |
|
425 | for f in m.files(): | |
420 | fl = repo.file(f) |
|
426 | fl = repo.file(f) | |
421 | for fr in fl: |
|
427 | for fr in fl: | |
@@ -500,10 +506,13 b' def hasfile(repo, subset, x):' | |||||
500 | """ |
|
506 | """ | |
501 | # i18n: "file" is a keyword |
|
507 | # i18n: "file" is a keyword | |
502 | pat = getstring(x, _("file requires a pattern")) |
|
508 | pat = getstring(x, _("file requires a pattern")) | |
503 | m = matchmod.match(repo.root, repo.getcwd(), [pat]) |
|
509 | m = None | |
504 | s = [] |
|
510 | s = [] | |
505 | for r in subset: |
|
511 | for r in subset: | |
506 |
|
|
512 | c = repo[r] | |
|
513 | if not m or matchmod.patkind(pat) == 'set': | |||
|
514 | m = matchmod.match(repo.root, repo.getcwd(), [pat], ctx=c) | |||
|
515 | for f in c.files(): | |||
507 | if m(f): |
|
516 | if m(f): | |
508 | s.append(r) |
|
517 | s.append(r) | |
509 | break |
|
518 | break |
General Comments 0
You need to be logged in to leave comments.
Login now