# HG changeset patch # User Will Maier # Date 2009-02-09 13:55:42 # Node ID b2410ed2cbe9a2d2f74048979378735d137836b2 # Parent 2b25483422653576c5651355ce0ddc79dd1ced0b Use shutil.copystat in copyfile(). diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -760,7 +760,7 @@ def unlink(f): 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 @@ def copyfile(src, dest): else: try: shutil.copyfile(src, dest) - shutil.copymode(src, dest) + shutil.copystat(src, dest) except shutil.Error, inst: raise Abort(str(inst))