mercurial/scmutil.py
changeset 29802 35560189677c
parent 29771 98976e3cae57
child 29994 0c40e64d6154
--- a/mercurial/scmutil.py	Sun Aug 14 14:46:24 2016 +0900
+++ b/mercurial/scmutil.py	Tue Aug 16 08:15:12 2016 +0000
@@ -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: