changeset 7767:b2410ed2cbe9

Use shutil.copystat in copyfile().
author Will Maier <willmaier@ml1.net>
date Mon, 09 Feb 2009 07:55:42 -0600
parents 2b2548342265
children 5bf5fd1e2a74
files mercurial/util.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
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))