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

svn commit: r1629857 - /subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c

Author: stefan2
Date: Tue Oct  7 10:53:00 2014
New Revision: 1629857

URL: http://svn.apache.org/r1629857
Log:
Make the FSFS hotcopy-internal function hotcopy_remove_file() slightly
more generic.  This is a mere preparation for a following commit.

* subversion/libsvn_fs_fs/hotcopy.c
  (hotcopy_remove_file): Instead shard path + local file name, take the
                         full file path as parameter.
  (hotcopy_remove_files): Update caller.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c?rev=1629857&r1=1629856&r2=1629857&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/hotcopy.c Tue Oct  7 10:53:00 2014
@@ -369,17 +369,15 @@ hotcopy_copy_packed_shard(svn_boolean_t 
   return SVN_NO_ERROR;
 }
 
-/* Remove FILE in SHARD folder.  Use POOL for temporary allocations. */
+/* Remove file PATH, if it exists - even if it is read-only. 
+ * Use POOL for temporary allocations. */
 static svn_error_t *
-hotcopy_remove_file(const char *shard,
-                    const char *file,
+hotcopy_remove_file(const char *path,
                     apr_pool_t *pool)
 {
-  const char *rev_path = svn_dirent_join(shard, file, pool);
-
   /* Make the rev file writable and remove it. */
-  SVN_ERR(svn_io_set_file_read_write(rev_path, TRUE, pool));
-  SVN_ERR(svn_io_remove_file2(rev_path, TRUE, pool));
+  SVN_ERR(svn_io_set_file_read_write(path, TRUE, pool));
+  SVN_ERR(svn_io_remove_file2(path, TRUE, pool));
 
   return SVN_NO_ERROR;
 }
@@ -419,8 +417,10 @@ hotcopy_remove_files(svn_fs_t *dst_fs,
         }
 
       /* remove files for REV */
-      SVN_ERR(hotcopy_remove_file(dst_subdir_shard,
-                                  apr_psprintf(iterpool, "%ld", rev),
+      SVN_ERR(hotcopy_remove_file(svn_dirent_join(dst_subdir_shard,
+                                                  apr_psprintf(iterpool,
+                                                               "%ld", rev),
+                                                  iterpool),
                                   iterpool));
     }