[PATCH 08 of 11] dirstate: do not add a and A on ci filesystems (issue1663)

Simon Heimberg simohe at besonet.ch
Fri Aug 7 14:43:06 CDT 2009


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1249671953 -7200
# Node ID 675061c3cf9196402db8602159c4f7943fc69231
# Parent  fe9daf0289c35269e91ae1efc76ed21ae8a63cb6
dirstate: do not add a and A on ci filesystems (issue1663)

use util.foldedpath and util.realpath for getting this
tested on linux with hfs

diff -r fe9daf0289c3 -r 675061c3cf91 mercurial/dirstate.py
--- a/mercurial/dirstate.py	Fre Aug 07 21:04:48 2009 +0200
+++ b/mercurial/dirstate.py	Fre Aug 07 21:05:53 2009 +0200
@@ -59,7 +59,7 @@
     def _foldmap(self):
         f = {}
         for name in self._map:
-            f[os.path.normcase(name)] = name
+            f[util.foldedpath(name)] = name
         return f
 
     @propertycache
@@ -340,14 +340,14 @@
             self._ui.warn(_("not in dirstate: %s\n") % f)
 
     def _normalize(self, path, knownpath):
-        norm_path = os.path.normcase(path)
+        norm_path = util.foldedpath(path)
         fold_path = self._foldmap.get(norm_path, None)
         if fold_path is None:
             if knownpath or not os.path.exists(os.path.join(self._root, path)):
                 fold_path = path
             else:
                 fold_path = self._foldmap.setdefault(norm_path,
-                                util.fspath(path, self._root))
+                                util.realpath(path, self._root))
         return fold_path
 
     def clear(self):


More information about the Mercurial-devel mailing list