You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2010/01/07 17:22:12 UTC

svn commit: r896915 - /subversion/trunk/subversion/libsvn_subr/io.c

Author: rhuijben
Date: Thu Jan  7 16:21:20 2010
New Revision: 896915

URL: http://svn.apache.org/viewvc?rev=896915&view=rev
Log:
On Windows don't retry a failed rename on every possible failure, but
only for access denied.

On the AnkhSVN error list we currently receive quite a few
    "Can't move '<PATH>\.svn\tmp\entries' to '<PATH>\.svn\entries':
        The system cannot find the file specified."
errors for Subversion 1.6.6 users who are updating their working copy.
The old code obscured the initial status code for this code path,
which makes it hard to determine the root cause. (The root cause is
most likely outside Subversion as we didn't see this error until early
November 2009)

* subversion/libsvn_subr/io.c
  (svn_io_file_rename): Only try setting writable if we are trying to
    resolve an access denied error. Then retry the move on further
    access denied errors.

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=896915&r1=896914&r2=896915&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Thu Jan  7 16:21:20 2010
@@ -3027,17 +3027,16 @@
   status = apr_file_rename(from_path_apr, to_path_apr, pool);
 
 #ifdef WIN32
-  if (status)
+  if (APR_STATUS_IS_EACCES(status))
     {
       /* Set the destination file writable because Windows will not
-         allow us to rename over files that are read-only. */
+         allow us to rename when to_path is read-only, but will
+         allow renaming when from_path is read only. */
       SVN_ERR(svn_io_set_file_read_write(to_path, TRUE, pool));
 
       status = apr_file_rename(from_path_apr, to_path_apr, pool);
-
-      WIN32_RETRY_LOOP(status,
-                       apr_file_rename(from_path_apr, to_path_apr, pool));
     }
+  WIN32_RETRY_LOOP(status, apr_file_rename(from_path_apr, to_path_apr, pool));
 #endif /* WIN32 */
 
   if (status)