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/07 21:38:37 UTC

svn commit: r1143997 - /subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c

Author: danielsh
Date: Thu Jul  7 19:38:37 2011
New Revision: 1143997

URL: http://svn.apache.org/viewvc?rev=1143997&view=rev
Log:
On the revprop-sharding branch:

Abort when encountering f5 filesystems.  (This just upgrades all callers
of read_format(), which hopefully is all the places where this check needs
to be added.)

* subversion/libsvn_fs_fs/fs_fs.c
  (check_format): Error out on f5.
  (upgrade_body, pack_body):
    Call check_format() after read_format().

Modified:
    subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c?rev=1143997&r1=1143996&r2=1143997&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_fs_fs/fs_fs.c Thu Jul  7 19:38:37 2011
@@ -1078,7 +1078,17 @@ check_format(int format)
 {
   /* We support all formats from 1-current simultaneously */
   if (1 <= format && format <= SVN_FS_FS__FORMAT_NUMBER)
-    return SVN_NO_ERROR;
+    {
+      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; dump using "
+                                   "1.7.0-alpha3, or upgrade using "
+                                   "tools/dev/unwritten.py"),
+                                 format);
+      else
+        return SVN_NO_ERROR;
+    }
 
   return svn_error_createf(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL,
      _("Expected FS format between '1' and '%d'; found format '%d'"),
@@ -1225,11 +1235,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),
@@ -1276,6 +1286,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),
@@ -7947,6 +7958,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. */