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 2013/07/01 15:41:31 UTC

svn commit: r1498444 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_x: fs.h fs_x.c hotcopy.c pack.c transaction.c util.c

Author: stefan2
Date: Mon Jul  1 13:41:31 2013
New Revision: 1498444

URL: http://svn.apache.org/r1498444
Log:
On the fsfs-format7 branch:  remove the SVN_FS_FS__MIN_PACKED_FORMAT flag
from FSX because we always pack revprops.  Remove checks for that flag
and the corresponding old FSFS format code.

* subversion/libsvn_fs_x/fs.h
  (SVN_FS_FS__MIN_PACKED_FORMAT): remove

* subversion/libsvn_fs_x/fs_x.c
  (svn_fs_x__open,
   svn_fs_x__create): remove check
  (svn_fs_x__open_pack_or_rev_file): remove check & pre-f7 code

* subversion/libsvn_fs_x/hotcopy.c
  (hotcopy_body): ditto
  (hotcopy_create_empty_dest): remove check

* subversion/libsvn_fs_x/pack.c
  (pack_body): simplify

* subversion/libsvn_fs_x/transaction.c
  (with_some_lock_file): remove check

* subversion/libsvn_fs_x/util.c
  (svn_fs_x__path_rev_absolute): remove check
  (svn_fs_x__update_min_unpacked_rev): simplify

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs.h
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs_x.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/hotcopy.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/pack.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/transaction.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_x/util.c

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs.h?rev=1498444&r1=1498443&r2=1498444&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs.h Mon Jul  1 13:41:31 2013
@@ -143,9 +143,6 @@ extern "C" {
 /* The minimum format number that allows rep sharing. */
 #define SVN_FS_FS__MIN_REP_SHARING_FORMAT 4
 
-/* The minimum format number that supports packed shards. */
-#define SVN_FS_FS__MIN_PACKED_FORMAT 4
-
 /* The minimum format number that stores node kinds in changed-paths lists. */
 #define SVN_FS_FS__MIN_KIND_IN_CHANGED_FORMAT 4
 

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs_x.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs_x.c?rev=1498444&r1=1498443&r2=1498444&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs_x.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/fs_x.c Mon Jul  1 13:41:31 2013
@@ -539,8 +539,7 @@ svn_fs_x__open(svn_fs_t *fs, const char 
   SVN_ERR(svn_io_file_close(uuid_file, pool));
 
   /* Read the min unpacked revision. */
-  if (ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
-    SVN_ERR(svn_fs_x__update_min_unpacked_rev(fs, pool));
+  SVN_ERR(svn_fs_x__update_min_unpacked_rev(fs, pool));
 
   /* Read the configuration file. */
   SVN_ERR(read_config(ffd, fs->path, pool));
@@ -657,7 +656,6 @@ svn_fs_x__open_pack_or_rev_file(apr_file
                                 svn_revnum_t rev,
                                 apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
   svn_error_t *err;
   svn_boolean_t retry = FALSE;
 
@@ -670,28 +668,19 @@ svn_fs_x__open_pack_or_rev_file(apr_file
                             APR_READ | APR_BUFFERED, APR_OS_DEFAULT, pool);
       if (err && APR_STATUS_IS_ENOENT(err->apr_err))
         {
-          if (ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
-            {
-              /* Could not open the file. This may happen if the
-               * file once existed but got packed later. */
-              svn_error_clear(err);
-
-              /* if that was our 2nd attempt, leave it at that. */
-              if (retry)
-                return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-                                         _("No such revision %ld"), rev);
-
-              /* We failed for the first time. Refresh cache & retry. */
-              SVN_ERR(svn_fs_x__update_min_unpacked_rev(fs, pool));
-
-              retry = TRUE;
-            }
-          else
-            {
-              svn_error_clear(err);
-              return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
-                                       _("No such revision %ld"), rev);
-            }
+          /* Could not open the file. This may happen if the
+            * file once existed but got packed later. */
+          svn_error_clear(err);
+
+          /* if that was our 2nd attempt, leave it at that. */
+          if (retry)
+            return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+                                     _("No such revision %ld"), rev);
+
+          /* We failed for the first time. Refresh cache & retry. */
+          SVN_ERR(svn_fs_x__update_min_unpacked_rev(fs, pool));
+
+          retry = TRUE;
         }
       else
         {
@@ -931,20 +920,15 @@ svn_fs_x__create(svn_fs_t *fs,
   SVN_ERR(read_config(ffd, fs->path, pool));
 
   /* Create the min unpacked rev file. */
-  if (ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
-    SVN_ERR(svn_io_file_create(svn_fs_x__path_min_unpacked_rev(fs, pool),
-                               "0\n", pool));
+  SVN_ERR(svn_io_file_create(svn_fs_x__path_min_unpacked_rev(fs, pool),
+                              "0\n", pool));
 
   /* Create the txn-current file if the repository supports
      the transaction sequence file. */
-  if (format >= SVN_FS_FS__MIN_TXN_CURRENT_FORMAT)
-    {
-      SVN_ERR(svn_io_file_create(svn_fs_x__path_txn_current(fs, pool),
-                                 "0\n", pool));
-      SVN_ERR(svn_io_file_create_empty(svn_fs_x__path_txn_current_lock(fs,
-                                                                       pool),
-                                       pool));
-    }
+  SVN_ERR(svn_io_file_create(svn_fs_x__path_txn_current(fs, pool),
+                             "0\n", pool));
+  SVN_ERR(svn_io_file_create_empty(svn_fs_x__path_txn_current_lock(fs, pool),
+                                   pool));
 
   /* This filesystem is ready.  Stamp it with a format number. */
   SVN_ERR(svn_fs_x__write_format(fs, FALSE, pool));

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/hotcopy.c?rev=1498444&r1=1498443&r2=1498444&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/hotcopy.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/hotcopy.c Mon Jul  1 13:41:31 2013
@@ -600,33 +600,25 @@ hotcopy_body(void *baton, apr_pool_t *po
     SVN_ERR(cancel_func(cancel_baton));
 
   /* Copy the min unpacked rev, and read its value. */
-  if (src_ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
-    {
-      SVN_ERR(svn_fs_x__read_min_unpacked_rev(&src_min_unpacked_rev, src_fs,
-                                              pool));
-      SVN_ERR(svn_fs_x__read_min_unpacked_rev(&dst_min_unpacked_rev, dst_fs,
-                                              pool));
-
-      /* We only support packs coming from the hotcopy source.
-       * The destination should not be packed independently from
-       * the source. This also catches the case where users accidentally
-       * swap the source and destination arguments. */
-      if (src_min_unpacked_rev < dst_min_unpacked_rev)
-        return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
-                                 _("The hotcopy destination already contains "
-                                   "more packed revisions (%lu) than the "
-                                   "hotcopy source contains (%lu)"),
-                                   dst_min_unpacked_rev - 1,
-                                   src_min_unpacked_rev - 1);
+  SVN_ERR(svn_fs_x__read_min_unpacked_rev(&src_min_unpacked_rev, src_fs,
+                                          pool));
+  SVN_ERR(svn_fs_x__read_min_unpacked_rev(&dst_min_unpacked_rev, dst_fs,
+                                          pool));
+
+  /* We only support packs coming from the hotcopy source.
+    * The destination should not be packed independently from
+    * the source. This also catches the case where users accidentally
+    * swap the source and destination arguments. */
+  if (src_min_unpacked_rev < dst_min_unpacked_rev)
+    return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                             _("The hotcopy destination already contains "
+                               "more packed revisions (%lu) than the "
+                               "hotcopy source contains (%lu)"),
+                             dst_min_unpacked_rev - 1,
+                             src_min_unpacked_rev - 1);
 
-      SVN_ERR(svn_io_dir_file_copy(src_fs->path, dst_fs->path,
-                                   PATH_MIN_UNPACKED_REV, pool));
-    }
-  else
-    {
-      src_min_unpacked_rev = 0;
-      dst_min_unpacked_rev = 0;
-    }
+  SVN_ERR(svn_io_dir_file_copy(src_fs->path, dst_fs->path,
+                               PATH_MIN_UNPACKED_REV, pool));
 
   if (cancel_func)
     SVN_ERR(cancel_func(cancel_baton));
@@ -701,8 +693,7 @@ hotcopy_body(void *baton, apr_pool_t *po
                                     iterpool);
       if (err)
         {
-          if (APR_STATUS_IS_ENOENT(err->apr_err) &&
-              src_ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
+          if (APR_STATUS_IS_ENOENT(err->apr_err))
             {
               svn_error_clear(err);
 
@@ -909,19 +900,16 @@ hotcopy_create_empty_dest(svn_fs_t *src_
   SVN_ERR(svn_fs_x__set_uuid(dst_fs, src_fs->uuid, pool));
 
   /* Create the min unpacked rev file. */
-  if (dst_ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
-    SVN_ERR(svn_io_file_create(svn_fs_x__path_min_unpacked_rev(dst_fs, pool),
-                               "0\n", pool));
+  SVN_ERR(svn_io_file_create(svn_fs_x__path_min_unpacked_rev(dst_fs, pool),
+                              "0\n", pool));
+
   /* Create the txn-current file if the repository supports
      the transaction sequence file. */
-  if (dst_ffd->format >= SVN_FS_FS__MIN_TXN_CURRENT_FORMAT)
-    {
-      SVN_ERR(svn_io_file_create(svn_fs_x__path_txn_current(dst_fs, pool),
-                                 "0\n", pool));
-      SVN_ERR(svn_io_file_create_empty(svn_fs_x__path_txn_current_lock(dst_fs,
-                                                                       pool),
-                                       pool));
-    }
+  SVN_ERR(svn_io_file_create(svn_fs_x__path_txn_current(dst_fs, pool),
+                             "0\n", pool));
+  SVN_ERR(svn_io_file_create_empty(svn_fs_x__path_txn_current_lock(dst_fs,
+                                                                   pool),
+                                   pool));
 
   dst_ffd->youngest_rev_cache = 0;
 

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/pack.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/pack.c?rev=1498444&r1=1498443&r2=1498444&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/pack.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/pack.c Mon Jul  1 13:41:31 2013
@@ -2302,13 +2302,6 @@ pack_body(void *baton,
   const char *rev_data_path;
   const char *revprops_data_path = NULL;
 
-  /* If the repository isn't a new enough format, we don't support packing.
-     Return a friendly error to that effect. */
-  if (ffd->format < SVN_FS_FS__MIN_PACKED_FORMAT)
-    return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
-      _("FSFS format (%d) too old to pack; please upgrade the filesystem."),
-      ffd->format);
-
   /* If we aren't using sharding, we can't do any packing, so quit. */
   if (!ffd->max_files_per_dir)
     return SVN_NO_ERROR;

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/transaction.c?rev=1498444&r1=1498443&r2=1498444&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/transaction.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/transaction.c Mon Jul  1 13:41:31 2013
@@ -244,8 +244,7 @@ with_some_lock_file(svn_fs_t *fs,
 
       /* nobody else will modify the repo state
          => read HEAD & pack info once */
-      if (ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT)
-        SVN_ERR(svn_fs_x__update_min_unpacked_rev(fs, pool));
+      SVN_ERR(svn_fs_x__update_min_unpacked_rev(fs, pool));
       SVN_ERR(svn_fs_x__youngest_rev(&ffd->youngest_rev_cache, fs, pool));
       err = body(baton, subpool);
     }

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_x/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_x/util.c?rev=1498444&r1=1498443&r2=1498444&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_x/util.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_x/util.c Mon Jul  1 13:41:31 2013
@@ -199,10 +199,7 @@ svn_fs_x__path_rev_absolute(svn_fs_t *fs
                             svn_revnum_t rev,
                             apr_pool_t *pool)
 {
-  fs_x_data_t *ffd = fs->fsap_data;
-
-  return (   ffd->format < SVN_FS_FS__MIN_PACKED_FORMAT
-          || ! svn_fs_x__is_packed_rev(fs, rev))
+  return ! svn_fs_x__is_packed_rev(fs, rev)
        ? svn_fs_x__path_rev(fs, rev, pool)
        : svn_fs_x__path_rev_packed(fs, rev, PATH_PACKED, pool);
 }
@@ -481,9 +478,6 @@ svn_error_t *
 svn_fs_x__update_min_unpacked_rev(svn_fs_t *fs, apr_pool_t *pool)
 {
   fs_x_data_t *ffd = fs->fsap_data;
-
-  SVN_ERR_ASSERT(ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT);
-
   return svn_fs_x__read_min_unpacked_rev(&ffd->min_unpacked_rev, fs, pool);
 }