Author: rhuijben
Date: Wed Jul  7 23:25:36 2010
New Revision: 961534

URL: http://svn.apache.org/viewvc?rev=961534&view=rev
Log:
Fix the Windows ra_serf buildbot failures by not installing existing
pristine files again.

This resolves the symptoms of the buildbot failures, but not the real
cause of the test failures: somehow we keep the filehandles open when
using ra_serf, but not while using different ra layers.

But this same issue will also trigger when we start using multiple clients
on one working copy and by file access by background processes, so
reinstalling the same file should be avoided anyway.

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_pristine_install): If the file already exists, just delete
    the to be installed tempfile and return.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=961534&r1=961533&r2=961534&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Jul  7 23:25:36 2010
@@ -2343,6 +2343,7 @@ svn_wc__db_pristine_install(svn_wc__db_t
   const char *pristine_abspath;
   apr_finfo_t finfo;
   svn_sqlite__stmt_t *stmt;
+  svn_node_kind_t kind;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(tempfile_abspath));
   SVN_ERR_ASSERT(sha1_checksum != NULL);
@@ -2368,9 +2369,20 @@ svn_wc__db_pristine_install(svn_wc__db_t
                              TRUE /* create_subdir */,
                              scratch_pool, scratch_pool));
 
+
+  SVN_ERR(svn_io_check_path(pristine_abspath, &kind, scratch_pool));
+
+  if (kind == svn_node_file)
+    {
+      /* Remove the tempfile, it's already there */
+      return svn_error_return(
+                  svn_io_remove_file2(tempfile_abspath,
+                                      FALSE, scratch_pool));
+    }
+
   /* Put the file into its target location.  */
-  SVN_ERR(svn_io_file_rename(tempfile_abspath, pristine_abspath,
-                             scratch_pool));
+    SVN_ERR(svn_io_file_rename(tempfile_abspath, pristine_abspath,
+                               scratch_pool));
 
   SVN_ERR(svn_io_stat(&finfo, pristine_abspath, APR_FINFO_SIZE,
                       scratch_pool));


Reply via email to