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 2012/07/07 09:47:01 UTC
svn commit: r1358519 - in /subversion/trunk/subversion/libsvn_fs_fs: fs.h
fs_fs.c
Author: stefan2
Date: Sat Jul 7 07:47:00 2012
New Revision: 1358519
URL: http://svn.apache.org/viewvc?rev=1358519&view=rev
Log:
Replace hard-coded strings for packing-related paths with symbolic names.
* subversion/libsvn_fs_fs/fs.h
(PATH_MANIFEST, PATH_PACKED, PATH_EXT_PACKED_SHARD): new path constants
* subversion/libsvn_fs_fs/fs_fs.c
(path_rev_packed, svn_fs_fs__path_rev_absolute, get_packed_offset,
pack_rev_shard, pack_shard, hotcopy_copy_packed_shard): use the new constants
Modified:
subversion/trunk/subversion/libsvn_fs_fs/fs.h
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
Modified: subversion/trunk/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs.h?rev=1358519&r1=1358518&r2=1358519&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs.h Sat Jul 7 07:47:00 2012
@@ -63,6 +63,10 @@ extern "C" {
has not been packed. */
#define PATH_REVPROP_GENERATION "revprop-generation"
/* Current revprop generation*/
+#define PATH_MANIFEST "manifest" /* Manifest file name */
+#define PATH_PACKED "pack" /* Packed revision data file */
+#define PATH_EXT_PACKED_SHARD ".pack" /* Extension for packed
+ shards */
/* If you change this, look at tests/svn_test_fs.c(maybe_install_fsfs_conf) */
#define PATH_CONFIG "fsfs.conf" /* Configuration */
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=1358519&r1=1358518&r2=1358519&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Sat Jul 7 07:47:00 2012
@@ -253,7 +253,8 @@ path_rev_packed(svn_fs_t *fs, svn_revnum
assert(is_packed_rev(fs, rev));
return svn_dirent_join_many(pool, fs->path, PATH_REVS_DIR,
- apr_psprintf(pool, "%ld.pack",
+ apr_psprintf(pool,
+ "%ld" PATH_EXT_PACKED_SHARD,
rev / ffd->max_files_per_dir),
kind, NULL);
}
@@ -303,7 +304,7 @@ svn_fs_fs__path_rev_absolute(const char
}
else
{
- *path = path_rev_packed(fs, rev, "pack", pool);
+ *path = path_rev_packed(fs, rev, PATH_PACKED, pool);
}
return SVN_NO_ERROR;
@@ -1779,7 +1780,8 @@ get_packed_offset(apr_off_t *rev_offset,
/* Open the manifest file. */
SVN_ERR(svn_stream_open_readonly(&manifest_stream,
- path_rev_packed(fs, rev, "manifest", pool),
+ path_rev_packed(fs, rev, PATH_MANIFEST,
+ pool),
pool, pool));
/* While we're here, let's just read the entire manifest file into an array,
@@ -8294,8 +8296,8 @@ pack_rev_shard(const char *pack_file_dir
apr_pool_t *iterpool;
/* Some useful paths. */
- pack_file_path = svn_dirent_join(pack_file_dir, "pack", pool);
- manifest_file_path = svn_dirent_join(pack_file_dir, "manifest", pool);
+ pack_file_path = svn_dirent_join(pack_file_dir, PATH_PACKED, pool);
+ manifest_file_path = svn_dirent_join(pack_file_dir, PATH_MANIFEST, pool);
/* Remove any existing pack file for this shard, since it is incomplete. */
SVN_ERR(svn_io_remove_dir2(pack_file_dir, TRUE, cancel_func, cancel_baton,
@@ -8380,7 +8382,9 @@ pack_shard(const char *revs_dir,
/* Some useful paths. */
rev_pack_file_dir = svn_dirent_join(revs_dir,
- apr_psprintf(pool, "%" APR_INT64_T_FMT ".pack", shard),
+ apr_psprintf(pool,
+ "%" APR_INT64_T_FMT PATH_EXT_PACKED_SHARD,
+ shard),
pool);
rev_shard_path = svn_dirent_join(revs_dir,
apr_psprintf(pool, "%" APR_INT64_T_FMT, shard),
@@ -8845,7 +8849,7 @@ hotcopy_copy_packed_shard(svn_revnum_t *
/* Copy the packed shard. */
src_subdir = svn_dirent_join(src_fs->path, PATH_REVS_DIR, scratch_pool);
dst_subdir = svn_dirent_join(dst_fs->path, PATH_REVS_DIR, scratch_pool);
- packed_shard = apr_psprintf(scratch_pool, "%ld.pack",
+ packed_shard = apr_psprintf(scratch_pool, "%ld" PATH_EXT_PACKED_SHARD,
rev / max_files_per_dir);
src_subdir_packed_shard = svn_dirent_join(src_subdir, packed_shard,
scratch_pool);