[PATCH 3 of 3] Add a normalize() method to dirstate

Matt Mackall mpm at selenic.com
Wed May 21 17:18:52 CDT 2008


On Wed, 2008-05-21 at 22:49 +0100, Paul Moore wrote:
> +    def normalize(self, path):
> +        if not self._folding or path in self._map:
> +            return path
> +        elif path in self._folded:
> +            return self._folded[path]
> +        elif os.path.exists(path):
> +            return self._folded.setdefault(path, util.fspath(path, self._root))

What if another variant of path is in self._map?

I think what's needed rather than _folding or _folded is something like:

_foldmap = {}
for f in _map:
  _foldmap[f.lower()] = _map[f]

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list