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 2012/09/24 15:19:13 UTC

svn commit: r1389352 - /subversion/trunk/tools/server-side/fsfs-reorg.c

Author: stefan2
Date: Mon Sep 24 13:19:12 2012
New Revision: 1389352

URL: http://svn.apache.org/viewvc?rev=1389352&view=rev
Log:
* tools/server-side/fsfs-reorg.c
  (prepare_repo,
   activate_new_revs): rename rep-cache.db after reorg because it is now invalid

Modified:
    subversion/trunk/tools/server-side/fsfs-reorg.c

Modified: subversion/trunk/tools/server-side/fsfs-reorg.c
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/server-side/fsfs-reorg.c?rev=1389352&r1=1389351&r2=1389352&view=diff
==============================================================================
--- subversion/trunk/tools/server-side/fsfs-reorg.c (original)
+++ subversion/trunk/tools/server-side/fsfs-reorg.c Mon Sep 24 13:19:12 2012
@@ -2360,6 +2360,8 @@ prepare_repo(const char *path, apr_pool_
   const char *old_path = svn_dirent_join(path, "db/old", pool);
   const char *new_path = svn_dirent_join(path, "new", pool);
   const char *revs_path = svn_dirent_join(path, "db/revs", pool);
+  const char *old_rep_cache_path = svn_dirent_join(path, "db/rep-cache.db.old", pool);
+  const char *rep_cache_path = svn_dirent_join(path, "db/rep-cache.db", pool);
   
   SVN_ERR(svn_io_check_path(old_path, &kind, pool));
   if (kind == svn_node_dir)
@@ -2370,6 +2372,10 @@ prepare_repo(const char *path, apr_pool_
       SVN_ERR(svn_io_remove_dir2(new_path, TRUE, NULL, NULL, pool));
     }
 
+  SVN_ERR(svn_io_check_path(old_rep_cache_path, &kind, pool));
+  if (kind == svn_node_file)
+    SVN_ERR(svn_io_file_move(old_rep_cache_path, rep_cache_path, pool));
+
   return SVN_NO_ERROR;
 }
 
@@ -2381,6 +2387,8 @@ activate_new_revs(const char *path, apr_
   const char *old_path = svn_dirent_join(path, "db/old", pool);
   const char *new_path = svn_dirent_join(path, "new", pool);
   const char *revs_path = svn_dirent_join(path, "db/revs", pool);
+  const char *old_rep_cache_path = svn_dirent_join(path, "db/rep-cache.db.old", pool);
+  const char *rep_cache_path = svn_dirent_join(path, "db/rep-cache.db", pool);
 
   SVN_ERR(svn_io_check_path(old_path, &kind, pool));
   if (kind == svn_node_none)
@@ -2389,6 +2397,10 @@ activate_new_revs(const char *path, apr_
       SVN_ERR(svn_io_file_move(new_path, revs_path, pool));
     }
 
+  SVN_ERR(svn_io_check_path(old_rep_cache_path, &kind, pool));
+  if (kind == svn_node_none)
+    SVN_ERR(svn_io_file_move(rep_cache_path, old_rep_cache_path, pool));
+
   return SVN_NO_ERROR;
 }