##// END OF EJS Templates
util: move getfstype() to the platform modules...
Matt Harbison -
r35527:beede158 default
parent child Browse files
Show More
@@ -24,9 +24,12 b' from .i18n import _'
24 from . import (
24 from . import (
25 encoding,
25 encoding,
26 error,
26 error,
27 policy,
27 pycompat,
28 pycompat,
28 )
29 )
29
30
31 osutil = policy.importmod(r'osutil')
32
30 posixfile = open
33 posixfile = open
31 normpath = os.path.normpath
34 normpath = os.path.normpath
32 samestat = os.path.samestat
35 samestat = os.path.samestat
@@ -302,6 +305,13 b' def checkosfilename(path):'
302 Returns None if the path is ok, or a UI string describing the problem.'''
305 Returns None if the path is ok, or a UI string describing the problem.'''
303 return None # on posix platforms, every path is ok
306 return None # on posix platforms, every path is ok
304
307
308 def getfstype(dirpath):
309 '''Get the filesystem type name from a directory (best-effort)
310
311 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
312 '''
313 return getattr(osutil, 'getfstype', lambda x: None)(dirpath)
314
305 def setbinary(fd):
315 def setbinary(fd):
306 pass
316 pass
307
317
@@ -109,6 +109,7 b' executablepath = platform.executablepath'
109 expandglobs = platform.expandglobs
109 expandglobs = platform.expandglobs
110 explainexit = platform.explainexit
110 explainexit = platform.explainexit
111 findexe = platform.findexe
111 findexe = platform.findexe
112 getfstype = platform.getfstype
112 gethgcmd = platform.gethgcmd
113 gethgcmd = platform.gethgcmd
113 getuser = platform.getuser
114 getuser = platform.getuser
114 getpid = os.getpid
115 getpid = os.getpid
@@ -1519,13 +1520,6 b' def fspath(name, root):'
1519
1520
1520 return ''.join(result)
1521 return ''.join(result)
1521
1522
1522 def getfstype(dirpath):
1523 '''Get the filesystem type name from a directory (best-effort)
1524
1525 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
1526 '''
1527 return getattr(osutil, 'getfstype', lambda x: None)(dirpath)
1528
1529 def checknlink(testfile):
1523 def checknlink(testfile):
1530 '''check whether hardlink count reporting works properly'''
1524 '''check whether hardlink count reporting works properly'''
1531
1525
@@ -226,6 +226,13 b' def checkexec(path):'
226 def checklink(path):
226 def checklink(path):
227 return False
227 return False
228
228
229 def getfstype(dirpath):
230 '''Get the filesystem type name from a directory (best-effort)
231
232 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc.
233 '''
234 return None
235
229 def setbinary(fd):
236 def setbinary(fd):
230 # When run without console, pipes may expose invalid
237 # When run without console, pipes may expose invalid
231 # fileno(), usually set to -1.
238 # fileno(), usually set to -1.
General Comments 0
You need to be logged in to leave comments. Login now