Fix normalize fail on non-lowercase filename (Issue1273)
authorAndrei Vermel <avermel@mail.ru>
Sat, 02 Aug 2008 19:34:50 +0400
changeset 6975 5e1a867e5d65
parent 6974 8997b81a33da
child 6976 b072266a83d1
child 6977 df96a0d1d79d
Fix normalize fail on non-lowercase filename (Issue1273) regression introduced in 1e2850ed8171
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Tue Sep 02 15:41:51 2008 +0200
+++ b/mercurial/dirstate.py	Sat Aug 02 19:34:50 2008 +0400
@@ -347,11 +347,12 @@
             self._ui.warn(_("not in dirstate: %s\n") % f)
 
     def _normalize(self, path):
-        if path not in self._foldmap:
+        norm_path = os.path.normcase(os.path.normpath(path))
+        if norm_path not in self._foldmap:
             if not os.path.exists(path):
                 return path
-            self._foldmap[path] = util.fspath(path, self._root)
-        return self._foldmap[path]
+            self._foldmap[norm_path] = util.fspath(path, self._root)
+        return self._foldmap[norm_path]
 
     def clear(self):
         self._map = {}