cext: implement osutil.getfstype() on Windows...
cext: implement osutil.getfstype() on Windows
This will allow NTFS to be added to the hardlink whitelist, and resume creating
hardlinks in transactions (which was disabled globally in 07a92bbd02e5; see also
e5ce49a30146). I'll wait until this is accepted before implementing the pure
version. It isn't clear to me if the API version should be bumped, but it's new
to Windows, so I assume the answer is "yes". I opted to report "cifs" for
remote volumes because this shows in `hg debugfs`, which also reports that
hardlinks are supported for these volumes. So being able to distinguish it from
"unknown" seems useful.
The documentation [1] seems to indicate that SMB isn't supported by these
functions, but experimenting shows that mapped drives are reported as "NTFS" on
Windows 7. I don't have a second Windows machine, but instead shared a temp
directory on C:\. In this setup, both of the following were detected as 'cifs'
with the explicit GetDriveType() check:
Z:\repo>hg ci -A
C:\>hg -R \\hostname\temp\repo ci -A # (without Z:\ being mapped)
It looks like this is called 6 times to add and commit a single new file, so I'm
a little surprised this isn't cached.
[1]
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364993(v=vs.85).aspx