hghave: add a check about whitelisted filesystem that supports hardlink
authorJun Wu <quark@fb.com>
Sun, 12 Mar 2017 00:26:20 -0800
changeset 31576 07f0cddb0594
parent 31575 e506e461c7a9
child 31577 e7a02e9ad162
hghave: add a check about whitelisted filesystem that supports hardlink This is needed for the test added by the next patch.
tests/hghave.py
--- a/tests/hghave.py	Sun Mar 12 00:23:07 2017 -0800
+++ b/tests/hghave.py	Sun Mar 12 00:26:20 2017 -0800
@@ -346,6 +346,12 @@
     finally:
         os.unlink(fn)
 
+@check("hardlink-whitelisted", "hardlinks on whitelisted filesystems")
+def has_hardlink_whitelisted():
+    from mercurial import osutil, util
+    fstype = getattr(osutil, 'getfstype', lambda x: None)('.')
+    return fstype in util._hardlinkfswhitelist
+
 @check("rmcwd", "can remove current working directory")
 def has_rmcwd():
     ocwd = os.getcwd()