You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2014/03/21 12:03:31 UTC

svn commit: r1579922 - in /subversion/trunk: subversion/svnsync/svnsync.c tools/client-side/bash_completion

Author: philip
Date: Fri Mar 21 11:03:30 2014
New Revision: 1579922

URL: http://svn.apache.org/r1579922
Log:
Introduce -M to set the FSFS cache size for file:// URLs with
svnsync.  The cache could already be controlled via the config
file, and the command line config support, so '-M' is a short
form of '--config-option config:miscellany:memory-cache-size='.

* subversion/svnsync/svnsync.c
  (svnsync_cmd_table): Add 'M' to synchronize and copy-revprops.
  (svnsync_options): Add 'M'.
  (sub_main): Handle '-M' and update the config.

* tools/client-side/bash_completion
  (_svnsync): Add -M.

Modified:
    subversion/trunk/subversion/svnsync/svnsync.c
    subversion/trunk/tools/client-side/bash_completion

Modified: subversion/trunk/subversion/svnsync/svnsync.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnsync/svnsync.c?rev=1579922&r1=1579921&r2=1579922&view=diff
==============================================================================
--- subversion/trunk/subversion/svnsync/svnsync.c (original)
+++ subversion/trunk/subversion/svnsync/svnsync.c Fri Mar 21 11:03:30 2014
@@ -112,7 +112,7 @@ static const svn_opt_subcommand_desc2_t 
          "mirror of the source repository.\n"),
       { SVNSYNC_OPTS_DEFAULT, svnsync_opt_source_prop_encoding, 'q',
         svnsync_opt_allow_non_empty, svnsync_opt_disable_locking,
-        svnsync_opt_steal_lock } },
+        svnsync_opt_steal_lock, 'M' } },
     { "synchronize", synchronize_cmd, { "sync" },
       N_("usage: svnsync synchronize DEST_URL [SOURCE_URL]\n"
          "\n"
@@ -125,7 +125,7 @@ static const svn_opt_subcommand_desc2_t 
          "if untrusted users/administrators may have write access to the\n"
          "DEST_URL repository.\n"),
       { SVNSYNC_OPTS_DEFAULT, svnsync_opt_source_prop_encoding, 'q',
-        svnsync_opt_disable_locking, svnsync_opt_steal_lock } },
+        svnsync_opt_disable_locking, svnsync_opt_steal_lock, 'M' } },
     { "copy-revprops", copy_revprops_cmd, { 0 },
       N_("usage:\n"
          "\n"
@@ -146,7 +146,7 @@ static const svn_opt_subcommand_desc2_t 
          "\n"
          "Form 2 is deprecated syntax, equivalent to specifying \"-rREV[:REV2]\".\n"),
       { SVNSYNC_OPTS_DEFAULT, svnsync_opt_source_prop_encoding, 'q', 'r',
-        svnsync_opt_disable_locking, svnsync_opt_steal_lock } },
+        svnsync_opt_disable_locking, svnsync_opt_steal_lock, 'M' } },
     { "info", info_cmd, { 0 },
       N_("usage: svnsync info DEST_URL\n"
          "\n"
@@ -237,6 +237,10 @@ static const apr_getopt_option_t svnsync
                           "and is not being concurrently accessed by another\n"
                           "                             "
                           "svnsync instance.")},
+    {"memory-cache-size", 'M', 1,
+                       N_("size of the extra in-memory cache in MB used to"
+                          "                             "
+                          "minimize operations for local 'file' scheme.\n")},
     {"version",        svnsync_opt_version, 0,
                        N_("show program version information")},
     {"help",           'h', 0,
@@ -2068,6 +2072,21 @@ sub_main(int *exit_code, int argc, const
               }
             break;
 
+          case 'M':
+            if (!config_options)
+              config_options =
+                    apr_array_make(pool, 1,
+                                   sizeof(svn_cmdline__config_argument_t*));
+
+            SVN_ERR(svn_utf_cstring_to_utf8(&opt_arg, opt_arg, pool));
+            SVN_ERR(svn_cmdline__parse_config_option(
+                      config_options,
+                      apr_psprintf(pool,
+                                   "config:miscellany:memory-cache-size=%s",
+                                   opt_arg),
+                      pool));
+            break;
+
           case '?':
           case 'h':
             opt_baton.help = TRUE;

Modified: subversion/trunk/tools/client-side/bash_completion
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/bash_completion?rev=1579922&r1=1579921&r2=1579922&view=diff
==============================================================================
--- subversion/trunk/tools/client-side/bash_completion (original)
+++ subversion/trunk/tools/client-side/bash_completion Fri Mar 21 11:03:30 2014
@@ -1388,7 +1388,8 @@ _svnsync ()
 	copy-revprops|initialize|init|synchronize|sync)
 		cmdOpts="--non-interactive --no-auth-cache --trust-server-cert \
 		         --source-username --source-password --sync-username \
-		         --sync-password --config-dir --config-option -q --quiet"
+		         --sync-password --config-dir --config-option \
+		         -q --quiet -M --memory-cache-size"
 		;;
 	help|h|\?)
 		cmdOpts="$cmds"