--- a/mercurial/match.py Fri Apr 24 14:30:30 2015 -0700
+++ b/mercurial/match.py Tue May 19 07:17:57 2015 -0500
@@ -274,6 +274,12 @@
self._files = [f[len(path) + 1:] for f in matcher._files
if f.startswith(path + "/")]
+
+ # If the parent repo had a path to this subrepo and no patterns are
+ # specified, this submatcher always matches.
+ if not self._always and not matcher._anypats:
+ self._always = any(f == path for f in matcher._files)
+
self._anypats = matcher._anypats
self.matchfn = lambda fn: matcher.matchfn(self._path + "/" + fn)
self._fileroots = set(self._files)