--- a/mercurial/posix.py Fri Dec 22 23:17:04 2017 +0800
+++ b/mercurial/posix.py Sat Dec 30 21:07:03 2017 -0500
@@ -24,9 +24,12 @@
from . import (
encoding,
error,
+ policy,
pycompat,
)
+osutil = policy.importmod(r'osutil')
+
posixfile = open
normpath = os.path.normpath
samestat = os.path.samestat
@@ -302,6 +305,13 @@
Returns None if the path is ok, or a UI string describing the problem.'''
return None # on posix platforms, every path is ok
+def getfstype(dirpath):
+ '''Get the filesystem type name from a directory (best-effort)
+
+ Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
+ '''
+ return getattr(osutil, 'getfstype', lambda x: None)(dirpath)
+
def setbinary(fd):
pass