AFAICT this works quite well, apart from one issue related to the
dirstate mishandling removed files. In particular,
tests/test-casefolding.t will have a lot of errors like this:
File ".../mercurial/dirstate.py", line 1888, in filefoldmap return self._rustmap.filefoldmapasdict()
TypeError: unhashable type: 'list'
Rust has fairly good support for obtaining the canonical path to a
file, so I just used that. With this change, the test still fails, but
now it just fails due to a subtle difference between the two
implementations:
- With the Python implementation, doing mv thefile TheFile does not affect hg status.
- With the Rust implementation, the results are the same as on a case-sensitive file system; one file is missing and the other is unknown.
Please note that this assumes a case preserving, but case insensitive
file system -- excluding FAT, I suspect.
Most of the Rust tests pass as well, apart from one PathAuditor test.
As stated by @marmoute, this should be its own patch, because the code is just broken without it and it can be accepted without the weight of the rest.