util: use util.getfstype
authorJun Wu <quark@fb.com>
Thu, 23 Mar 2017 12:01:18 -0700
changeset 31594 4a1bf30f5438
parent 31593 ae02cc1f5369
child 31595 e8bd005c0af7
util: use util.getfstype
mercurial/util.py
--- a/mercurial/util.py	Thu Mar 23 11:58:45 2017 -0700
+++ b/mercurial/util.py	Thu Mar 23 12:01:18 2017 -0700
@@ -1086,8 +1086,7 @@
     if hardlink:
         # Hardlinks are problematic on CIFS (issue4546), do not allow hardlinks
         # unless we are confident that dest is on a whitelisted filesystem.
-        destdir = os.path.dirname(dest)
-        fstype = getattr(osutil, 'getfstype', lambda x: None)(destdir)
+        fstype = getfstype(os.path.dirname(dest))
         if fstype not in _hardlinkfswhitelist:
             hardlink = False
     if hardlink: