Mercurial > hg
comparison mercurial/posix.py @ 35513:c4caf530b1c7
util: add a function to show the mount point of the filesystem
For now, this is Windows only, since Linux doesn't have the value in its statfs
structure, and I don't have a BSD system to test with.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 29 Dec 2017 22:54:14 -0500 |
parents | beede158ea8a |
children | ed95758addf3 |
comparison
equal
deleted
inserted
replaced
35512:5cc1becd0493 | 35513:c4caf530b1c7 |
---|---|
303 def checkosfilename(path): | 303 def checkosfilename(path): |
304 '''Check that the base-relative path is a valid filename on this platform. | 304 '''Check that the base-relative path is a valid filename on this platform. |
305 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.''' |
306 return None # on posix platforms, every path is ok | 306 return None # on posix platforms, every path is ok |
307 | 307 |
308 def getfsmountpoint(dirpath): | |
309 '''Get the filesystem mount point from a directory (best-effort) | |
310 | |
311 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc. | |
312 ''' | |
313 return getattr(osutil, 'getfsmountpoint', lambda x: None)(dirpath) | |
314 | |
308 def getfstype(dirpath): | 315 def getfstype(dirpath): |
309 '''Get the filesystem type name from a directory (best-effort) | 316 '''Get the filesystem type name from a directory (best-effort) |
310 | 317 |
311 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc. | 318 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc. |
312 ''' | 319 ''' |