diff mercurial/dirstate.py @ 24539:3a8eba78803e

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.
author Siddharth Agarwal <sid0@fb.com>
date Sat, 28 Mar 2015 18:53:54 -0700
parents 24df92075200
children 25c1d3ca5ff6
line wrap: on
line diff
--- 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)