Show More
@@ -2415,11 +2415,7 b' def files(ui, ctx, m, fm, fmt, subrepos)' | |||
|
2415 | 2415 | ret = 0 |
|
2416 | 2416 | |
|
2417 | 2417 | for subpath in sorted(ctx.substate): |
|
2418 |
|
|
|
2419 | return (m.exact(subpath) | |
|
2420 | or any(f.startswith(subpath + '/') for f in m.files())) | |
|
2421 | ||
|
2422 | if subrepos or matchessubrepo(subpath): | |
|
2418 | if subrepos or m.matchessubrepo(subpath): | |
|
2423 | 2419 | sub = ctx.sub(subpath) |
|
2424 | 2420 | try: |
|
2425 | 2421 | submatch = matchmod.subdirmatcher(subpath, m) |
@@ -2450,16 +2446,8 b' def remove(ui, repo, m, prefix, after, f' | |||
|
2450 | 2446 | total = len(subs) |
|
2451 | 2447 | count = 0 |
|
2452 | 2448 | for subpath in subs: |
|
2453 | def matchessubrepo(matcher, subpath): | |
|
2454 | if matcher.exact(subpath): | |
|
2455 | return True | |
|
2456 | for f in matcher.files(): | |
|
2457 | if f.startswith(subpath): | |
|
2458 | return True | |
|
2459 | return False | |
|
2460 | ||
|
2461 | 2449 | count += 1 |
|
2462 |
if subrepos or matchessubrepo( |
|
|
2450 | if subrepos or m.matchessubrepo(subpath): | |
|
2463 | 2451 | ui.progress(_('searching'), count, total=total, unit=_('subrepos')) |
|
2464 | 2452 | |
|
2465 | 2453 | sub = wctx.sub(subpath) |
@@ -320,6 +320,10 b' class match(object):' | |||
|
320 | 320 | kindpats.append((kind, pat, '')) |
|
321 | 321 | return kindpats |
|
322 | 322 | |
|
323 | def matchessubrepo(self, subpath): | |
|
324 | return (self.exact(subpath) | |
|
325 | or any(f.startswith(subpath + '/') for f in self.files())) | |
|
326 | ||
|
323 | 327 | def exact(root, cwd, files, badfn=None): |
|
324 | 328 | return match(root, cwd, files, exact=True, badfn=badfn) |
|
325 | 329 |
@@ -948,17 +948,9 b' def addremove(repo, matcher, prefix, opt' | |||
|
948 | 948 | ret = 0 |
|
949 | 949 | join = lambda f: os.path.join(prefix, f) |
|
950 | 950 | |
|
951 | def matchessubrepo(matcher, subpath): | |
|
952 | if matcher.exact(subpath): | |
|
953 | return True | |
|
954 | for f in matcher.files(): | |
|
955 | if f.startswith(subpath): | |
|
956 | return True | |
|
957 | return False | |
|
958 | ||
|
959 | 951 | wctx = repo[None] |
|
960 | 952 | for subpath in sorted(wctx.substate): |
|
961 |
if opts.get('subrepos') or matchessubrepo( |
|
|
953 | if opts.get('subrepos') or m.matchessubrepo(subpath): | |
|
962 | 954 | sub = wctx.sub(subpath) |
|
963 | 955 | try: |
|
964 | 956 | submatch = matchmod.subdirmatcher(subpath, m) |
General Comments 0
You need to be logged in to leave comments.
Login now