changeset 11254:640d419725d0 stable

util.copyfiles: don't try os_link() again if it failed before If the os_link() call on the first file in the directory fails [1], we switch mode to using shutil.copy() for all remaining files. [1] happens for example on Windows for every file when cloning from a UNC path without specifying --pull.
author Adrian Buehlmann <adrian@cadifra.com>
date Fri, 28 May 2010 17:28:34 +0200
parents 0bb67503ad4b
children e4dbaa40096d
files mercurial/util.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Mon May 31 21:37:01 2010 +0200
+++ b/mercurial/util.py	Fri May 28 17:28:34 2010 +0200
@@ -451,7 +451,7 @@
         for name, kind in osutil.listdir(src):
             srcname = os.path.join(src, name)
             dstname = os.path.join(dst, name)
-            copyfiles(srcname, dstname, hardlink)
+            hardlink = copyfiles(srcname, dstname, hardlink)
     else:
         if hardlink:
             try:
@@ -462,6 +462,8 @@
         else:
             shutil.copy(src, dst)
 
+    return hardlink
+
 class path_auditor(object):
     '''ensure that a filesystem path contains no banned components.
     the following properties of a path are checked: