Author: stefan2
Date: Sat Oct 18 23:47:23 2014
New Revision: 1632866

URL: http://svn.apache.org/r1632866
Log:
More preparation on 'svnfsfs load-index': Move the revision format check
from the UI part into the logic part.

* subversion/svnfsfs/load-index-cmd.c
  (svn_fs_fs__load_index): Check that the revision does have an index.
  (load_index): Remove the check here.

Modified:
    subversion/trunk/subversion/svnfsfs/load-index-cmd.c

Modified: subversion/trunk/subversion/svnfsfs/load-index-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svnfsfs/load-index-cmd.c?rev=1632866&r1=1632865&r2=1632866&view=diff
==============================================================================
--- subversion/trunk/subversion/svnfsfs/load-index-cmd.c (original)
+++ subversion/trunk/subversion/svnfsfs/load-index-cmd.c Sat Oct 18 23:47:23 
2014
@@ -134,6 +134,10 @@ svn_fs_fs__load_index(svn_fs_t *fs,
 {
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
+  /* Check the FS format number. */
+  if (! svn_fs_fs__use_log_addressing(fs, revision))
+    return svn_error_create(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL, NULL);
+
   /* Treat an empty array as a no-op instead error. */
   if (entries->nelts != 0)
     {
@@ -213,13 +217,7 @@ load_index(const char *path,
        * Get a revision from (probably inside) the respective shard. */
       if (   revision == SVN_INVALID_REVNUM
           && entry->item.revision != SVN_INVALID_REVNUM)
-        {
-          revision = entry->item.revision;
-
-          /* Check the FS format number. */
-          if (! svn_fs_fs__use_log_addressing(fs, revision))
-            return svn_error_create(SVN_ERR_FS_UNSUPPORTED_FORMAT, NULL, NULL);
-        }
+        revision = entry->item.revision;
     }
 
   /* Rewrite the indexes. */


Reply via email to