You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2011/07/08 22:44:34 UTC

svn commit: r1144502 - in /subversion/trunk: ./ subversion/libsvn_fs_fs/fs_fs.c

Author: danielsh
Date: Fri Jul  8 20:44:33 2011
New Revision: 1144502

URL: http://svn.apache.org/viewvc?rev=1144502&view=rev
Log:
Merge r1143997,r1144499 from the revprop-packing branch.

This makes FSFS complain when opening or accessing a format-5 (f5) filesystem,
created only by 1.7-dev builds and never released.

Modified:
    subversion/trunk/   (props changed)
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Propchange: subversion/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul  8 20:44:33 2011
@@ -39,7 +39,7 @@
 /subversion/branches/py-tests-as-modules:956579-1033052
 /subversion/branches/ra_serf-digest-authn:875693-876404
 /subversion/branches/reintegrate-improvements:873853-874164
-/subversion/branches/revprop-packing:1143971,1144017
+/subversion/branches/revprop-packing:1143971,1143997,1144017,1144499
 /subversion/branches/subtree-mergeinfo:876734-878766
 /subversion/branches/svn-mergeinfo-enhancements:870119-870195,870197-870288
 /subversion/branches/svn-patch-improvements:918519-934609

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1144502&r1=1144501&r2=1144502&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Fri Jul  8 20:44:33 2011
@@ -1077,6 +1077,16 @@ write_format(const char *path, int forma
 static svn_error_t *
 check_format(int format)
 {
+  /* Blacklist.  These formats may be either younger or older than
+     SVN_FS_FS__FORMAT_NUMBER, but we don't support them. */
+  if (format == SVN_FS_FS__PACKED_REVPROP_SQLITE_DEV_FORMAT)
+    return svn_error_createf(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
+                             _("Found format '%d', only created by "
+                               "unreleased dev builds; see "
+                               "http://subversion.apache.org"
+                               "/docs/release-notes/1.7#revprop-packing"),
+                             format);
+
   /* We support all formats from 1-current simultaneously */
   if (1 <= format && format <= SVN_FS_FS__FORMAT_NUMBER)
     return SVN_NO_ERROR;
@@ -1247,11 +1257,11 @@ svn_fs_fs__open(svn_fs_t *fs, const char
   /* Read the FS format number. */
   SVN_ERR(read_format(&format, &max_files_per_dir,
                       path_format(fs, pool), pool));
+  SVN_ERR(check_format(format));
 
   /* Now we've got a format number no matter what. */
   ffd->format = format;
   ffd->max_files_per_dir = max_files_per_dir;
-  SVN_ERR(check_format(format));
 
   /* Read in and cache the repository uuid. */
   SVN_ERR(svn_io_file_open(&uuid_file, path_uuid(fs, pool),
@@ -1314,6 +1324,7 @@ upgrade_body(void *baton, apr_pool_t *po
 
   /* Read the FS format number and max-files-per-dir setting. */
   SVN_ERR(read_format(&format, &max_files_per_dir, format_path, pool));
+  SVN_ERR(check_format(format));
 
   /* If the config file does not exist, create one. */
   SVN_ERR(svn_io_check_path(svn_dirent_join(fs->path, PATH_CONFIG, pool),
@@ -7931,6 +7942,7 @@ pack_body(void *baton,
 
   SVN_ERR(read_format(&format, &max_files_per_dir, path_format(pb->fs, pool),
                       pool));
+  SVN_ERR(check_format(format));
 
   /* If the repository isn't a new enough format, we don't support packing.
      Return a friendly error to that effect. */