# HG changeset patch # User Drew Gottlieb # Date 1426286171 25200 # Node ID 637da5711122c5f3028518eaf1fa8eb5bcbbe5d1 # Parent 79d9c51488ca2fb11384331f48de1986ee89a87b manifest: have context use self.hasdir() A couple places in context currently use "x in self._dirs" to check for the existence of the directory, but this requires that all directories be loaded into a dict. Calling hasdir() instead puts the work on the the manifest to check for the existence of a directory in the most efficient manner. diff -r 79d9c51488ca -r 637da5711122 mercurial/context.py --- a/mercurial/context.py Fri Mar 13 15:32:45 2015 -0700 +++ b/mercurial/context.py Fri Mar 13 15:36:11 2015 -0700 @@ -607,10 +607,8 @@ if match(fn): yield fn for fn in sorted(fset): - if fn in self._dirs: - # specified pattern is a directory - continue - match.bad(fn, _('no such file in rev %s') % self) + if not self.hasdir(fn): + match.bad(fn, _('no such file in rev %s') % self) def matches(self, match): return self.walk(match) @@ -1564,7 +1562,7 @@ def bad(f, msg): # 'f' may be a directory pattern from 'match.files()', # so 'f not in ctx1' is not enough - if f not in other and f not in other.dirs(): + if f not in other and not other.hasdir(f): self._repo.ui.warn('%s: %s\n' % (self._repo.dirstate.pathto(f), msg)) match.bad = bad