Index: subversion/libsvn_subr/io.c =================================================================== --- subversion/libsvn_subr/io.c (revision 6064) +++ subversion/libsvn_subr/io.c (working copy) @@ -1445,6 +1445,20 @@ status = apr_file_rename (from_path_apr, to_path_apr, pool); +#ifdef SVN_WIN32 + /* Due to an apparent bug in Windows, sometimes 'access denied' will be + returned when it should not be -- a short sleep (1ms) and retrying + correctly finishes the operation. See the dev mailing list archives + for extensive discussion and further details (search for MoveFileEx + and/or 'Access Denied'). */ + + if (APR_TO_OS_ERROR (status) == ERROR_ACCESS_DENIED) + { + apr_sleep (1000); + status = apr_file_rename (from_path_apr, to_path_apr, pool); + } +#endif + if (status) return svn_error_createf (status, NULL, "svn_io_file_rename: can't move '%s' to '%s'",