# HG changeset patch # User Siddharth Agarwal # Date 1427594034 25200 # Node ID 3a8eba78803e994aed95ed07b121dcd28911b373 # Parent 24df9207520046b02ed5763c6aa5ae1915e88f65 dirstate: introduce function to normalize just filenames This will be used in upcoming patches to stop generating the set of directories in many common cases. diff -r 24df92075200 -r 3a8eba78803e mercurial/dirstate.py --- a/mercurial/dirstate.py Sun Mar 29 19:23:05 2015 -0700 +++ b/mercurial/dirstate.py Sat Mar 28 18:53:54 2015 -0700 @@ -490,6 +490,17 @@ return folded + def _normalizefile(self, path, isknown, ignoremissing=False, exists=None): + normed = util.normcase(path) + folded = self._foldmap.get(normed, None) + if folded is None: + if isknown: + folded = path + else: + folded = self._discoverpath(path, normed, ignoremissing, exists, + self._foldmap) + return folded + def _normalize(self, path, isknown, ignoremissing=False, exists=None): normed = util.normcase(path) folded = self._foldmap.get(normed, None)