diff -r ccfb56450f21 -r cb42050f2dad mercurial/scmutil.py --- 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)