transaction: use 'util.copyfile' for creating backup
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 05 Jan 2015 12:44:15 -0800
changeset 23900 5eb3541f907e
parent 23899 4e451d1359de
child 23901 13268fde4c4d
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.
mercurial/transaction.py
--- 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 = ''