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.
--- 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)