mercurial/cmdutil.py
changeset 23326 f6b8d23492e5
parent 23325 4165cfd67519
child 23327 bd296bb4b5c8
--- a/mercurial/cmdutil.py	Sat Nov 15 21:36:19 2014 -0500
+++ b/mercurial/cmdutil.py	Wed Nov 12 23:15:20 2014 -0500
@@ -2060,8 +2060,16 @@
 
     wctx = repo[None]
 
-    if subrepos:
-        for subpath in sorted(wctx.substate):
+    for subpath in sorted(wctx.substate):
+        def matchessubrepo(matcher, subpath):
+            if matcher.exact(subpath):
+                return True
+            for f in matcher.files():
+                if f.startswith(subpath):
+                    return True
+            return False
+
+        if subrepos or matchessubrepo(m, subpath):
             sub = wctx.sub(subpath)
             try:
                 submatch = matchmod.narrowmatcher(subpath, m)
@@ -2080,7 +2088,7 @@
                     return True
             return False
 
-        if f in repo.dirstate or f in wctx.dirs() or (subrepos and insubrepo()):
+        if f in repo.dirstate or f in wctx.dirs() or insubrepo():
             continue
 
         if os.path.exists(m.rel(join(f))):