Comments
Patch
@@ -2415,10 +2415,10 @@
ret = 0
for subpath in sorted(ctx.substate):
- if subrepos or m.matchessubrepo(subpath):
+ submatch = matchmod.subdirmatcher(subpath, m)
+ if (subrepos or m.exact(subpath) or any(submatch.files())):
sub = ctx.sub(subpath)
try:
- submatch = matchmod.subdirmatcher(subpath, m)
recurse = m.exact(subpath) or subrepos
if sub.printfiles(ui, submatch, fm, fmt, recurse) == 0:
ret = 0
@@ -2447,12 +2447,11 @@
count = 0
for subpath in subs:
count += 1
- if subrepos or m.matchessubrepo(subpath):
+ submatch = matchmod.subdirmatcher(subpath, m)
+ if subrepos or m.exact(subpath) or any(submatch.files()):
ui.progress(_('searching'), count, total=total, unit=_('subrepos'))
-
sub = wctx.sub(subpath)
try:
- submatch = matchmod.subdirmatcher(subpath, m)
if sub.removefiles(submatch, prefix, after, force, subrepos,
warnings):
ret = 1
@@ -949,10 +949,10 @@
wctx = repo[None]
for subpath in sorted(wctx.substate):
- if opts.get('subrepos') or m.matchessubrepo(subpath):
+ submatch = matchmod.subdirmatcher(subpath, m)
+ if opts.get('subrepos') or m.exact(subpath) or any(submatch.files()):
sub = wctx.sub(subpath)
try:
- submatch = matchmod.subdirmatcher(subpath, m)
if sub.addremove(submatch, prefix, opts, dry_run, similarity):
ret = 1
except error.LookupError: