mercurial/util.py
changeset 31151 b4cd912d7704
parent 31125 3f8f53190d6a
child 31323 7c877cbf30d6
--- a/mercurial/util.py	Thu Mar 02 20:30:56 2017 -0500
+++ b/mercurial/util.py	Thu Mar 02 10:12:40 2017 -0800
@@ -1056,6 +1056,11 @@
 
     return check
 
+# Hardlinks are problematic on CIFS, do not allow hardlinks
+# until we find a way to work around it cleanly (issue4546).
+# This is a variable so extensions can opt-in to using them.
+allowhardlinks = False
+
 def copyfile(src, dest, hardlink=False, copystat=False, checkambig=False):
     '''copy a file, preserving mode and optionally other stat info like
     atime/mtime
@@ -1072,9 +1077,7 @@
         if checkambig:
             oldstat = checkambig and filestat(dest)
         unlink(dest)
-    # hardlinks are problematic on CIFS, quietly ignore this flag
-    # until we find a way to work around it cleanly (issue4546)
-    if False and hardlink:
+    if allowhardlinks and hardlink:
         try:
             oslink(src, dest)
             return