subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1671385 - in /subversion/branches/fsx-1.10/subversion: libsvn_fs_x/hotcopy.c libsvn_fs_x/revprops.c libsvn_fs_x/util.c tests/cmdline/svnadmin_tests.py tests/libsvn_fs_x/fs-x-pack-test.c
Date Sun, 05 Apr 2015 11:48:22 GMT
Author: stefan2
Date: Sun Apr  5 11:48:22 2015
New Revision: 1671385

URL: http://svn.apache.org/r1671385
Log:
On the fsx-1.10 branch:
Prepare merger of rev and revprops folder in FSX.  Packed shard contents
already uses a disjoint set of names between revs and revprops.  So, we
only need to prefix non-packed files.  We put a "r" in front of each rev
file and a "p" in front of each revprop file.

* subversion/libsvn_fs_x/util.c
  (svn_fs_x__path_rev,
   svn_fs_x__path_revprops): Prefix non-packed file names.

* subversion/libsvn_fs_x/hotcopy.c
  (hotcopy_copy_shard_file): Distinguish between rev and revprop file
                             such that we use the correct file name.
  (hotcopy_copy_packed_shard): Update caller. Remove obsolute special
                               treatment of rev 0 revprops.
  (hotcopy_revisions): Update caller.

* subversion/libsvn_fs_x/revprops.c
  (svn_fs_x__pack_revprops_shard): Update non-packed file name.

* subversion/tests/cmdline/svnadmin_tests.py
  (verify_quickly): Same.

* subversion/tests/libsvn_fs_x/fs-x-pack-test.c
  (recover_fully_packed): Same.

Modified:
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/hotcopy.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c
    subversion/branches/fsx-1.10/subversion/libsvn_fs_x/util.c
    subversion/branches/fsx-1.10/subversion/tests/cmdline/svnadmin_tests.py
    subversion/branches/fsx-1.10/subversion/tests/libsvn_fs_x/fs-x-pack-test.c

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/hotcopy.c?rev=1671385&r1=1671384&r2=1671385&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/hotcopy.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/hotcopy.c Sun Apr  5 11:48:22 2015
@@ -243,6 +243,7 @@ hotcopy_io_copy_dir_recursively(svn_bool
  * to DST_SUBDIR. Assume a sharding layout based on MAX_FILES_PER_DIR.
  * Set *SKIPPED_P to FALSE only if the file was copied, do not change the
  * value in *SKIPPED_P otherwise. SKIPPED_P may be NULL if not required.
+ * If PROPS is set, copy the revprops file, otherwise copy the rev data file.
  * Use SCRATCH_POOL for temporary allocations. */
 static svn_error_t *
 hotcopy_copy_shard_file(svn_boolean_t *skipped_p,
@@ -250,6 +251,7 @@ hotcopy_copy_shard_file(svn_boolean_t *s
                         const char *dst_subdir,
                         svn_revnum_t rev,
                         int max_files_per_dir,
+                        svn_boolean_t props,
                         apr_pool_t *scratch_pool)
 {
   const char *src_subdir_shard = src_subdir,
@@ -269,7 +271,9 @@ hotcopy_copy_shard_file(svn_boolean_t *s
 
   SVN_ERR(hotcopy_io_dir_file_copy(skipped_p,
                                    src_subdir_shard, dst_subdir_shard,
-                                   apr_psprintf(scratch_pool, "%ld", rev),
+                                   apr_psprintf(scratch_pool, "%c%ld",
+                                                props ? 'p' : 'r',
+                                                rev),
                                    scratch_pool));
   return SVN_NO_ERROR;
 }
@@ -329,18 +333,12 @@ hotcopy_copy_packed_shard(svn_boolean_t
 
           SVN_ERR(hotcopy_copy_shard_file(skipped_p, src_subdir, dst_subdir,
                                           revprop_rev, max_files_per_dir,
-                                          iterpool));
+                                          TRUE, iterpool));
         }
       svn_pool_destroy(iterpool);
     }
   else
     {
-      /* revprop for revision 0 will never be packed */
-      if (rev == 0)
-        SVN_ERR(hotcopy_copy_shard_file(skipped_p, src_subdir, dst_subdir,
-                                        0, max_files_per_dir,
-                                        scratch_pool));
-
       /* packed revprops folder */
       packed_shard = apr_psprintf(scratch_pool, "%ld" PATH_EXT_PACKED_SHARD,
                                   rev / max_files_per_dir);
@@ -677,13 +675,13 @@ hotcopy_revisions(svn_fs_t *src_fs,
 
       /* Copy the rev file. */
       SVN_ERR(hotcopy_copy_shard_file(&skipped, src_revs_dir, dst_revs_dir,
-                                      rev, max_files_per_dir,
+                                      rev, max_files_per_dir, FALSE,
                                       iterpool));
 
       /* Copy the revprop file. */
       SVN_ERR(hotcopy_copy_shard_file(&skipped, src_revprops_dir,
                                       dst_revprops_dir,
-                                      rev, max_files_per_dir, 
+                                      rev, max_files_per_dir, TRUE,
                                       iterpool));
 
       /* Whenever this revision did not previously exist in the destination,

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c?rev=1671385&r1=1671384&r2=1671385&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/revprops.c Sun Apr  5 11:48:22 2015
@@ -1768,7 +1768,7 @@ svn_fs_x__pack_revprops_shard(svn_fs_t *
     {
       /* Never pack revprops for r0, just copy it. */
       SVN_ERR(svn_io_copy_file(svn_fs_x__path_revprops(fs, 0, iterpool),
-                               svn_dirent_join(pack_file_dir, "0",
+                               svn_dirent_join(pack_file_dir, "p0",
                                                scratch_pool),
                                TRUE,
                                iterpool));

Modified: subversion/branches/fsx-1.10/subversion/libsvn_fs_x/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/libsvn_fs_x/util.c?rev=1671385&r1=1671384&r2=1671385&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/libsvn_fs_x/util.c (original)
+++ subversion/branches/fsx-1.10/subversion/libsvn_fs_x/util.c Sun Apr  5 11:48:22 2015
@@ -200,8 +200,9 @@ svn_fs_x__path_rev(svn_fs_t *fs,
                    svn_revnum_t rev,
                    apr_pool_t *result_pool)
 {
-  char buffer[SVN_INT64_BUFFER_SIZE];
-  svn__i64toa(buffer, rev);
+  char buffer[SVN_INT64_BUFFER_SIZE + 1];
+  buffer[0] = 'r';
+  svn__i64toa(buffer + 1, rev);
 
   assert(! svn_fs_x__is_packed_rev(fs, rev));
   return construct_shard_sub_path(fs, rev, FALSE, FALSE, buffer, result_pool);
@@ -238,8 +239,9 @@ svn_fs_x__path_revprops(svn_fs_t *fs,
                         svn_revnum_t rev,
                         apr_pool_t *result_pool)
 {
-  char buffer[SVN_INT64_BUFFER_SIZE];
-  svn__i64toa(buffer, rev);
+  char buffer[SVN_INT64_BUFFER_SIZE + 1];
+  buffer[0] = 'p';
+  svn__i64toa(buffer + 1, rev);
 
   assert(! svn_fs_x__is_packed_revprop(fs, rev));
 

Modified: subversion/branches/fsx-1.10/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/cmdline/svnadmin_tests.py?rev=1671385&r1=1671384&r2=1671385&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/fsx-1.10/subversion/tests/cmdline/svnadmin_tests.py Sun Apr  5 11:48:22
2015
@@ -2598,7 +2598,10 @@ def verify_quickly(sbox):
   "verify quickly using metadata"
 
   sbox.build(create_wc = False)
-  rev_file = open(fsfs_file(sbox.repo_dir, 'revs', '1'), 'r+b')
+  if svntest.main.is_fs_type_fsfs():
+    rev_file = open(fsfs_file(sbox.repo_dir, 'revs', '1'), 'r+b')
+  else:
+    rev_file = open(fsfs_file(sbox.repo_dir, 'revs', 'r1'), 'r+b')
 
   # set new contents
   rev_file.seek(8)

Modified: subversion/branches/fsx-1.10/subversion/tests/libsvn_fs_x/fs-x-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsx-1.10/subversion/tests/libsvn_fs_x/fs-x-pack-test.c?rev=1671385&r1=1671384&r2=1671385&view=diff
==============================================================================
--- subversion/branches/fsx-1.10/subversion/tests/libsvn_fs_x/fs-x-pack-test.c (original)
+++ subversion/branches/fsx-1.10/subversion/tests/libsvn_fs_x/fs-x-pack-test.c Sun Apr  5
11:48:22 2015
@@ -658,7 +658,7 @@ recover_fully_packed(const svn_test_opts
      time we want to see an error! */
   SVN_ERR(svn_io_remove_file2(
               svn_dirent_join_many(pool, REPO_NAME, PATH_REVPROPS_DIR,
-                                   apr_psprintf(pool, "%ld/%ld",
+                                   apr_psprintf(pool, "%ld/p%ld",
                                                 after_rev / SHARD_SIZE,
                                                 after_rev),
                                    SVN_VA_NULL),



Mime
View raw message