# HG changeset patch # User Pierre-Yves David # Date 1420490655 28800 # Node ID 5eb3541f907efe47dcb1bf03bc1437316942a5cf # Parent 4e451d1359deb1ec236261721ff412eba1e168fb 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. diff -r 4e451d1359de -r 5eb3541f907e 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 = ''