[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[patch] hotcopy fails on fsfs.conf that has never been created

From: Peter Samuelson <peter_at_p12n.org>
Date: Thu, 29 Jul 2010 04:19:02 -0500

[Stefan Sperling]
> So my vote is: leave it as is, but print a more informative error message
> suggesting to create the file (so that people don't have to post to
> users@ to be instructed to do so), and make svnadmin upgrade create it.

I guess the common case is that the source of a hotcopy is _not_ the
target of a previous hotcopy of a 1.6.x repository by 1.6.0 - 1.6.11.
In which case the following simple patch should be sufficient. I'm not
sure if svnadmin should explain the full situation with the 1.6.0 bug.

Untested.

Peter

[[[
* subversion/libsvn_fs_fs/fs.h
  (SVN_FS_FS__MIN_CONFIG_FORMAT): New define.

* subversion/libsvn_fs_fs/fs_fs.c
  (upgrade_body): Create fsfs.conf when upgrading a repository from < 1.6.0.
  (svn_fs_fs__hotcopy): Only copy fsfs.conf if the repository is >= 1.6.0.
]]]

Index: subversion/libsvn_fs_fs/fs.h
===================================================================
--- subversion/libsvn_fs_fs/fs.h (revision 980368)
+++ subversion/libsvn_fs_fs/fs.h (working copy)
@@ -122,6 +122,9 @@ extern "C" {
 /* The minimum format number that stores node kinds in changed-paths lists. */
 #define SVN_FS_FS__MIN_KIND_IN_CHANGED_FORMAT 4

+/* The minimum format number that supports a db/fsfs.conf file. */
+#define SVN_FS_FS__MIN_CONFIG_FORMAT 4
+
 /* The minimum format number that supports packed revprop shards. */
 #define SVN_FS_FS__MIN_PACKED_REVPROP_FORMAT 5

Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 980368)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -1326,6 +1326,9 @@ upgrade_body(void *baton, apr_pool_t *pool)
                                           STMT_CREATE_SCHEMA));
     }

+ if (format < SVN_FS_FS__MIN_CONFIG_FORMAT)
+ SVN_ERR(write_config(fs, pool));
+
   /* Bump the format file. */
   return write_format(format_path, SVN_FS_FS__FORMAT_NUMBER, max_files_per_dir,
                       TRUE, pool);
@@ -1503,7 +1506,8 @@ svn_fs_fs__hotcopy(const char *src_path,
   SVN_ERR(svn_io_dir_file_copy(src_path, dst_path, PATH_UUID, pool));

   /* Copy the config. */
- SVN_ERR(svn_io_dir_file_copy(src_path, dst_path, PATH_CONFIG, pool));
+ if (format >= SVN_FS_FS__MIN_CONFIG_FORMAT)
+ SVN_ERR(svn_io_dir_file_copy(src_path, dst_path, PATH_CONFIG, pool));

   /* Copy the rep cache before copying the rev files to make sure all
      cached references will be present in the copy. */
Received on 2010-07-29 11:18:58 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.