diff -r 32ece991955c -r e411774a2e0f mercurial/context.py --- a/mercurial/context.py Tue Jul 10 20:23:55 2018 +0530 +++ b/mercurial/context.py Thu Aug 02 23:50:47 2018 -0700 @@ -372,6 +372,10 @@ for rfiles, sfiles in zip(r, s): rfiles.extend("%s/%s" % (subpath, f) for f in sfiles) + narrowmatch = self._repo.narrowmatch() + if not narrowmatch.always(): + for l in r: + l[:] = list(filter(narrowmatch, l)) for l in r: l.sort()