diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -376,7 +376,7 @@ class dirstate(object): 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)): diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -164,6 +164,10 @@ def samedevice(fpath1, fpath2): 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): diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -44,6 +44,7 @@ lookupreg = platform.lookupreg makedir = platform.makedir nlinks = platform.nlinks normpath = platform.normpath +normcase = platform.normcase nulldev = platform.nulldev openhardlinks = platform.openhardlinks oslink = platform.oslink diff --git a/mercurial/windows.py b/mercurial/windows.py --- a/mercurial/windows.py +++ b/mercurial/windows.py @@ -131,6 +131,8 @@ def localpath(path): 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 diff --git a/tests/test-convert-bzr-directories.t b/tests/test-convert-bzr-directories.t --- a/tests/test-convert-bzr-directories.t +++ b/tests/test-convert-bzr-directories.t @@ -165,15 +165,15 @@ divergent nested renames (issue3089) a => b $ mkdir a $ bzr add a - adding a + add(ed|ing) a (re) $ bzr mv b/c a/c b/c => a/c $ bzr status added: a/ renamed: - a/ => b/ - a/c/ => a/c/ + a/? => b/? (re) + a/c/? => a/c/? (re) $ bzr commit -q -m 'Divergent renames' $ cd .. $ hg convert source source-hg