util: add a getfstype method
The util version is a thin wrapper of the osutil version, which is not
always available.
--- a/mercurial/util.py Mon Mar 20 00:19:33 2017 -0400
+++ b/mercurial/util.py Thu Mar 23 11:58:45 2017 -0700
@@ -1367,6 +1367,13 @@
return ''.join(result)
+def getfstype(dirpath):
+ '''Get the filesystem type name from a directory (best-effort)
+
+ Returns None if we are unsure, or errors like ENOENT, EPERM happen.
+ '''
+ return getattr(osutil, 'getfstype', lambda x: None)(dirpath)
+
def checknlink(testfile):
'''check whether hardlink count reporting works properly'''