On Tue, Jul 20, 2010 at 18:32, Simon Atanasyan <[email protected]> wrote:
> The patch itself is in the attachment.
The missed patch file.
--
Simon Atanasyan
VisualSVN Limited
Index: subversion/svnadmin/main.c
===================================================================
--- subversion/svnadmin/main.c (revision 965818)
+++ subversion/svnadmin/main.c (working copy)
@@ -218,6 +218,7 @@
svnadmin__force_uuid,
svnadmin__fs_type,
svnadmin__parent_dir,
+ svnadmin__fsfs_no_rep_sharing,
svnadmin__bdb_txn_nosync,
svnadmin__bdb_log_keep,
svnadmin__config_dir,
@@ -276,6 +277,9 @@
{"parent-dir", svnadmin__parent_dir, 1,
N_("load at specified directory in repository")},
+ {"fsfs-no-repsharing", svnadmin__fsfs_no_rep_sharing, 0,
+ N_("disable rep-sharing in the repository [FSFS]")},
+
{"bdb-txn-nosync", svnadmin__bdb_txn_nosync, 0,
N_("disable fsync at transaction commit [Berkeley DB]")},
@@ -340,6 +344,7 @@
("usage: svnadmin create REPOS_PATH\n\n"
"Create a new, empty repository at REPOS_PATH.\n"),
{svnadmin__bdb_txn_nosync, svnadmin__bdb_log_keep,
+ svnadmin__fsfs_no_rep_sharing,
svnadmin__config_dir, svnadmin__fs_type, svnadmin__pre_1_4_compatible,
svnadmin__pre_1_5_compatible, svnadmin__pre_1_6_compatible,
svnadmin__pre_1_7_compatible} },
@@ -505,6 +510,7 @@
svn_boolean_t use_pre_revprop_change_hook; /*
--use-pre-revprop-change-hook */
svn_boolean_t use_post_revprop_change_hook; /*
--use-post-revprop-change-hook */
svn_boolean_t quiet; /* --quiet */
+ svn_boolean_t fsfs_no_rep_sharing; /* --fsfs-no-repsharing */
svn_boolean_t bdb_txn_nosync; /* --bdb-txn-nosync */
svn_boolean_t bdb_log_keep; /* --bdb-log-keep */
svn_boolean_t clean_logs; /* --clean-logs */
@@ -556,6 +562,10 @@
apr_hash_t *config;
apr_hash_t *fs_config = apr_hash_make(pool);
+ apr_hash_set(fs_config, SVN_FS_CONFIG_FSFS_REP_SHARING,
+ APR_HASH_KEY_STRING,
+ (opt_state->fsfs_no_rep_sharing ? "0" : "1"));
+
apr_hash_set(fs_config, SVN_FS_CONFIG_BDB_TXN_NOSYNC,
APR_HASH_KEY_STRING,
(opt_state->bdb_txn_nosync ? "1" : "0"));
@@ -1713,6 +1723,9 @@
case svnadmin__use_post_revprop_change_hook:
opt_state.use_post_revprop_change_hook = TRUE;
break;
+ case svnadmin__fsfs_no_rep_sharing:
+ opt_state.fsfs_no_rep_sharing = TRUE;
+ break;
case svnadmin__bdb_txn_nosync:
opt_state.bdb_txn_nosync = TRUE;
break;
Index: subversion/include/svn_fs.h
===================================================================
--- subversion/include/svn_fs.h (revision 965818)
+++ subversion/include/svn_fs.h (working copy)
@@ -72,6 +72,7 @@
*/
#define SVN_FS_CONFIG_BDB_TXN_NOSYNC "bdb-txn-nosync"
#define SVN_FS_CONFIG_BDB_LOG_AUTOREMOVE "bdb-log-autoremove"
+#define SVN_FS_CONFIG_FSFS_REP_SHARING "fsfs-rep-sharing"
/* See also svn_fs_type(). */
/** @since New in 1.1. */
Index: subversion/libsvn_fs_fs/fs_fs.c
===================================================================
--- subversion/libsvn_fs_fs/fs_fs.c (revision 965818)
+++ subversion/libsvn_fs_fs/fs_fs.c (working copy)
@@ -1135,12 +1135,40 @@
"### The following parameter enables rep-sharing in the repository. It can" NL
"### be switched on and off at will, but for best space-saving results" NL
"### should be enabled consistently over the life of the repository." NL
-"# " CONFIG_OPTION_ENABLE_REP_SHARING " = true" NL
+;
-;
+ apr_file_t *fsfs_conf_file;
+ void *cfg_value = NULL;
+ const char *cfg_str;
+
+ SVN_ERR(svn_io_file_open(&fsfs_conf_file,
+ svn_dirent_join(fs->path, PATH_CONFIG, pool),
+ APR_WRITE | APR_CREATE, APR_OS_DEFAULT,
+ fs->pool));
+
+ SVN_ERR(svn_io_file_write_full(fsfs_conf_file, fsfs_conf_contents,
+ strlen(fsfs_conf_contents), NULL,
+ fs->pool));
+
+ /* Get enable-rep-sharing option value from the config. */
+ if (fs->config)
+ cfg_value = apr_hash_get(fs->config,
+ SVN_FS_CONFIG_FSFS_REP_SHARING,
+ APR_HASH_KEY_STRING);
+
+ /* Build enable-rep-sharing option string representation. */
+ if (cfg_value != NULL && strcmp(cfg_value, "1") != 0)
+ cfg_str = CONFIG_OPTION_ENABLE_REP_SHARING " = false" NL;
+ else
+ cfg_str = "# " CONFIG_OPTION_ENABLE_REP_SHARING " = true" NL;
+
+ /* Write enable-rep-sharing option to the config file. */
+ SVN_ERR(svn_io_file_write_full(fsfs_conf_file,
+ cfg_str, strlen(cfg_str),
+ NULL, fs->pool));
+
#undef NL
- return svn_io_file_create(svn_dirent_join(fs->path, PATH_CONFIG, pool),
- fsfs_conf_contents, pool);
+ return svn_io_file_close(fsfs_conf_file, fs->pool);
}
static svn_error_t *
Index: tools/client-side/bash_completion
===================================================================
--- tools/client-side/bash_completion (revision 965818)
+++ tools/client-side/bash_completion (working copy)
@@ -1046,7 +1046,8 @@
case ${COMP_WORDS[1]} in
create)
cmdOpts="--bdb-txn-nosync --bdb-log-keep --config-dir \
- --fs-type --pre-1.4-compatible --pre-1.5-compatible"
+ --fs-type --pre-1.4-compatible --pre-1.5-compatible \
+ --fsfs-no-repsharing"
;;
deltify)
cmdOpts="-r --revision -q --quiet"