Patchwork [2,of,3] util: use util.getfstype

login
register
mail settings
Submitter Jun Wu
Date March 23, 2017, 7:07 p.m.
Message ID <bff5a7461d770ed6db75.1490296065@localhost.localdomain>
Download mbox | patch
Permalink /patch/19612/
State Accepted
Headers show

Comments

Jun Wu - March 23, 2017, 7:07 p.m.
# HG changeset patch
# User Jun Wu <quark@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

Patch

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