Author: ivan
Date: Tue Jun 16 12:26:18 2015
New Revision: 1685793
URL: http://svn.apache.org/r1685793
Log:
Remove unnecessary code in svn_io_file_move().
* subversion/libsvn_subr/io.c
(svn_io_file_move): Do not copy to temporary file for cross-volume moves,
because svn_io_copy_file() already performs atomic copy via temporary
file.
Modified:
subversion/trunk/subversion/libsvn_subr/io.c
Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1685793&r1=1685792&r2=1685793&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Tue Jun 16 12:26:18 2015
@@ -4060,36 +4060,11 @@ svn_io_file_move(const char *from_path,
if (err && APR_STATUS_IS_EXDEV(err->apr_err))
{
- const char *tmp_to_path;
-
svn_error_clear(err);
- SVN_ERR(svn_io_open_unique_file3(NULL, &tmp_to_path,
- svn_dirent_dirname(to_path, pool),
- svn_io_file_del_none,
- pool, pool));
-
- err = svn_error_trace(svn_io_copy_file(from_path, tmp_to_path, TRUE,
+ /* svn_io_copy_file() performs atomic copy via temporary file. */
+ err = svn_error_trace(svn_io_copy_file(from_path, to_path, TRUE,
pool));
- if (err)
- goto failed_tmp;
-
- err = svn_error_trace(svn_io_file_rename(tmp_to_path, to_path, pool));
- if (err)
- goto failed_tmp;
-
- err = svn_error_trace(svn_io_remove_file2(from_path, FALSE, pool));
- if (! err)
- return SVN_NO_ERROR;
-
- return svn_error_compose_create(
- err,
- svn_error_trace(svn_io_remove_file2(to_path, FALSE, pool)));
-
- failed_tmp:
- err = svn_error_compose_create(
- err,
- svn_error_trace(svn_io_remove_file2(tmp_to_path, FALSE, pool)));
}
return err;