diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -164,7 +164,7 @@ class manifestdict(object): return self.copy() files = match.files() - if (match.matchfn == match.exact or + if ((match.matchfn == match.exact and len(files) < 100) or (not match.anypats() and util.all(fn in self for fn in files))): return self.intersectfiles(files)