Use shutil.copystat in copyfile().
authorWill Maier <willmaier@ml1.net>
Mon, 09 Feb 2009 07:55:42 -0600
changeset 7767 b2410ed2cbe9
parent 7766 2b2548342265
child 7768 5bf5fd1e2a74
Use shutil.copystat in copyfile().
mercurial/util.py
--- 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))