Mercurial > hg
view hgweb.cgi @ 35510:2062f7c2ac83
win32: implement util.getfstype()
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 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
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 29 Dec 2017 21:28:19 -0500 |
parents | 4b0fc75f9403 |
children | 47ef023d0165 |
line wrap: on
line source
#!/usr/bin/env python # # An example hgweb CGI script, edit as necessary # See also https://mercurial-scm.org/wiki/PublishingRepositories # Path to repo or hgweb config to serve (see 'hg help hgweb') config = "/path/to/repo/or/config" # Uncomment and adjust if Mercurial is not installed system-wide # (consult "installed modules" path from 'hg debuginstall'): #import sys; sys.path.insert(0, "/path/to/python/lib") # Uncomment to send python tracebacks to the browser if an error occurs: #import cgitb; cgitb.enable() from mercurial import demandimport; demandimport.enable() from mercurial.hgweb import hgweb, wsgicgi application = hgweb(config) wsgicgi.launch(application)