[PATCH 2 of 3] util: use util.getfstype

Jun Wu quark at fb.com
Thu Mar 23 15:07:45 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1490295678 25200
#      Thu Mar 23 12:01:18 2017 -0700
# Node ID bff5a7461d770ed6db75b446d518b272fe423a47
# Parent  235f1212559d03f115e21992b5725a7dc7787632
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r bff5a7461d77
util: use util.getfstype

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1087,6 +1087,5 @@ def copyfile(src, dest, hardlink=False, 
         # 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


More information about the Mercurial-devel mailing list