diff -r b38bcf18993c -r 6514030dc686 mercurial/dirstate.py --- a/mercurial/dirstate.py Tue Mar 31 19:29:39 2015 -0700 +++ b/mercurial/dirstate.py Tue Mar 31 19:34:37 2015 -0700 @@ -509,8 +509,9 @@ def _normalize(self, path, isknown, ignoremissing=False, exists=None): normed = util.normcase(path) - folded = self._filefoldmap.get(normed, - self._dirfoldmap.get(normed, None)) + folded = self._filefoldmap.get(normed, None) + if folded is None: + folded = self._dirfoldmap.get(normed, None) if folded is None: if isknown: folded = path