Mercurial > hg
changeset 15488:6eff984d8e76 stable
dirstate: fix case-folding identity for traditional Unix
We used to use os.path.normcase which was a no-op, which was unhelpful
for cases like VFAT on Linux.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 15 Nov 2011 14:25:11 -0600 |
parents | 3c72117a7a0e |
children | 25ea33fe7e5c e99facd2cd2a |
files | mercurial/dirstate.py mercurial/posix.py mercurial/util.py mercurial/windows.py |
diffstat | 4 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dirstate.py Tue Nov 15 17:16:17 2011 +0100 +++ b/mercurial/dirstate.py Tue Nov 15 14:25:11 2011 -0600 @@ -376,7 +376,7 @@ del self._map[f] def _normalize(self, path, isknown): - normed = os.path.normcase(path) + normed = util.normcase(path) folded = self._foldmap.get(normed, None) if folded is None: if isknown or not os.path.lexists(os.path.join(self._root, path)):
--- a/mercurial/posix.py Tue Nov 15 17:16:17 2011 +0100 +++ b/mercurial/posix.py Tue Nov 15 14:25:11 2011 -0600 @@ -164,6 +164,10 @@ st2 = os.lstat(fpath2) return st1.st_dev == st2.st_dev +# os.path.normcase is a no-op, which doesn't help us on non-native filesystems +def normcase(path): + return path.lower() + if sys.platform == 'darwin': import fcntl # only needed on darwin, missing on jython def realpath(path):
--- a/mercurial/util.py Tue Nov 15 17:16:17 2011 +0100 +++ b/mercurial/util.py Tue Nov 15 14:25:11 2011 -0600 @@ -44,6 +44,7 @@ makedir = platform.makedir nlinks = platform.nlinks normpath = platform.normpath +normcase = platform.normcase nulldev = platform.nulldev openhardlinks = platform.openhardlinks oslink = platform.oslink
--- a/mercurial/windows.py Tue Nov 15 17:16:17 2011 +0100 +++ b/mercurial/windows.py Tue Nov 15 14:25:11 2011 -0600 @@ -131,6 +131,8 @@ def normpath(path): return pconvert(os.path.normpath(path)) +normcase = os.path.normcase + def realpath(path): ''' Returns the true, canonical file system path equivalent to the given