dirstate: introduce function to normalize just filenames
authorSiddharth Agarwal <sid0@fb.com>
Sat, 28 Mar 2015 18:53:54 -0700
changeset 24539 3a8eba78803e
parent 24538 24df92075200
child 24540 25c1d3ca5ff6
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.
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)