changeset 23900:5eb3541f907e

transaction: use 'util.copyfile' for creating backup Using 'copyfile' (single file) instead of 'copyfiles' (tree) will ensures destination file will be overwritten. This will prevent some abort if backup file are left in place for random reason. It also seems more correct.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 05 Jan 2015 12:44:15 -0800
parents 4e451d1359de
children 13268fde4c4d
files mercurial/transaction.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/transaction.py	Mon Jan 05 12:39:09 2015 -0800
+++ b/mercurial/transaction.py	Mon Jan 05 12:44:15 2015 -0800
@@ -206,7 +206,7 @@
         if vfs.exists(file):
             filepath = vfs.join(file)
             backuppath = vfs.join(backupfile)
-            util.copyfiles(filepath, backuppath, hardlink=hardlink)
+            util.copyfile(filepath, backuppath, hardlink=hardlink)
         else:
             backupfile = ''