diff mercurial/util.py @ 7767:b2410ed2cbe9

Use shutil.copystat in copyfile().
author Will Maier <willmaier@ml1.net>
date Mon, 09 Feb 2009 07:55:42 -0600
parents 3793802ea41b
children 9892c4d94fb7
line wrap: on
line diff
--- a/mercurial/util.py	Sun Feb 08 15:58:39 2009 +0100
+++ b/mercurial/util.py	Mon Feb 09 07:55:42 2009 -0600
@@ -760,7 +760,7 @@
         pass
 
 def copyfile(src, dest):
-    "copy a file, preserving mode"
+    "copy a file, preserving mode and atime/mtime"
     if os.path.islink(src):
         try:
             os.unlink(dest)
@@ -770,7 +770,7 @@
     else:
         try:
             shutil.copyfile(src, dest)
-            shutil.copymode(src, dest)
+            shutil.copystat(src, dest)
         except shutil.Error, inst:
             raise Abort(str(inst))