mercurial/scmutil.py
changeset 23539 cb42050f2dad
parent 23537 f1b06a8aad42
child 23581 aed981c7bebf
--- a/mercurial/scmutil.py	Mon Nov 24 23:51:26 2014 -0500
+++ b/mercurial/scmutil.py	Sun Nov 09 23:46:25 2014 -0500
@@ -723,9 +723,17 @@
     ret = 0
     join = lambda f: os.path.join(prefix, f)
 
+    def matchessubrepo(matcher, subpath):
+        if matcher.exact(subpath):
+            return True
+        for f in matcher.files():
+            if f.startswith(subpath):
+                return True
+        return False
+
     wctx = repo[None]
     for subpath in sorted(wctx.substate):
-        if opts.get('subrepos'):
+        if opts.get('subrepos') or matchessubrepo(m, subpath):
             sub = wctx.sub(subpath)
             try:
                 submatch = matchmod.narrowmatcher(subpath, m)