Fix normalize fail on non-lowercase filename (Issue1273)
regression introduced in 1e2850ed8171
--- 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 = {}