# HG changeset patch # User Benoit Boissinot # Date 2008-09-02 13:08:26 # Node ID b3bc518a73c30ff8951f888eb008de30f1e46c61 # Parent f7f0388f7bce9b426dae1937b45c467007c43515 performance: do not stat() things when not required Ignore unknown files if we don't need them (eg in hg diff). It slows things down a little bit for big trees (kernel repo), since _join() is called for each file instead of for each directory. fix issue567 diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -434,12 +434,15 @@ class dirstate(object): self._ui.warn(_('%s: unsupported file type (type is %s)\n') % (self.pathto(f), kind)) - # TODO: don't walk unknown directories if unknown and ignored are False ignore = self._ignore dirignore = self._dirignore if ignored: ignore = util.never dirignore = util.never + elif not unknown: + # if unknown and ignored are False, skip step 2 + ignore = util.always + dirignore = util.always matchfn = match.matchfn dmap = self._map