Author: philip
Date: Tue Feb 19 13:36:30 2013
New Revision: 1447716
URL: http://svn.apache.org/r1447716
Log:
Change the working copy exclusive locking default to off and require
explict enabling by the user. Allow Windows users to enable exclusive
locking.
* subversion/include/svn_config.h
(SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE_CLIENTS): New.
* subversion/libsvn_subr/config_file.c
(svn_config_ensure): Add new option to default file contents.
* subversion/svn/svn.c
(SVN_CL_NO_DEFAULT_EXCLUSIVE_LOCK): Rename to ...
(SVN_CL_NO_EXCLUSIVE_LOCK): ... this.
(sub_main): Use new option.
Modified:
subversion/trunk/subversion/include/svn_config.h
subversion/trunk/subversion/libsvn_subr/config_file.c
subversion/trunk/subversion/svn/svn.c
Modified: subversion/trunk/subversion/include/svn_config.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_config.h?rev=1447716&r1=1447715&r2=1447716&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_config.h (original)
+++ subversion/trunk/subversion/include/svn_config.h Tue Feb 19 13:36:30 2013
@@ -127,6 +127,7 @@ typedef struct svn_config_t svn_config_t
#define SVN_CONFIG_SECTION_WORKING_COPY "working-copy"
/** @since New in 1.8. */
#define SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE "exclusive-locking"
+#define SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE_CLIENTS "exclusive-locking-clients"
/** @} */
/** @name Repository conf directory configuration files strings
Modified: subversion/trunk/subversion/libsvn_subr/config_file.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config_file.c?rev=1447716&r1=1447715&r2=1447716&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/config_file.c (original)
+++ subversion/trunk/subversion/libsvn_subr/config_file.c Tue Feb 19 13:36:30
2013
@@ -1175,8 +1175,18 @@ svn_config_ensure(const char *config_dir
"" NL
"### Section for configuring working copies." NL
"[working-copy]" NL
- "### Set to true to enable exclusive SQLite locking. Some clients" NL
- "### may not support exclusive locking." NL
+ "### Set to a list of the names of specific clients that should use" NL
+ "### exclusive SQLite locking of working copies. This increases the"NL
+ "### performance of the client but prevents concurrent access by" NL
+ "### other clients." NL
+ "### Possible values:" NL
+ "### svn (the command line client)" NL
+ "### Third-party clients may also support this option." NL
+ "# exclusive-locking-clients =" NL
+ "### Set to true to enable exclusive SQLite locking of working" NL
+ "### copies by all clients. Enabling this may cause some clients" NL
+ "### to fail to work properly. This does not have to be set for" NL
+ "### exclusive-locking-clients to work." NL
"# exclusive-locking = false"
NL;
err = svn_io_file_open(&f, path,
Modified: subversion/trunk/subversion/svn/svn.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/svn.c?rev=1447716&r1=1447715&r2=1447716&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Tue Feb 19 13:36:30 2013
@@ -2525,30 +2525,30 @@ sub_main(int argc, const char *argv[], a
"svn: ", "--config-option"));
}
-#if !defined(SVN_CL_NO_DEFAULT_EXCLUSIVE_LOCK) && !defined(WIN32)
+#if !defined(SVN_CL_NO_EXCLUSIVE_LOCK)
{
- const char *sqlite_exclusive;
+ const char *exclusive_clients_option;
+ apr_array_header_t *exclusive_clients;
- svn_config_get(cfg_config, &sqlite_exclusive,
+ svn_config_get(cfg_config, &exclusive_clients_option,
SVN_CONFIG_SECTION_WORKING_COPY,
- SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE,
+ SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE_CLIENTS,
NULL);
- /* #########################################################################
- This blocks every other application from accessing our wc.db at the same
- time as this process. So instead of using the working copy lock functions
- as designed other processes will already block before being able to check
- that the working copy is locked and without a way to report what blocks
- it or being able to recover using 'svn cleanup' when a process gets stuck
-
- BH: I call this a breaking change, but let's discuss that on [email protected].
- first. This behavior should be opt-in, not opt-out until 2.0.
- #########################################################################
- */
- if (!sqlite_exclusive)
- svn_config_set(cfg_config,
- SVN_CONFIG_SECTION_WORKING_COPY,
- SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE,
- "true");
+ exclusive_clients = svn_cstring_split(exclusive_clients_option,
+ " ,", TRUE, pool);
+ for (i = 0; i < exclusive_clients->nelts; ++i)
+ {
+ const char *exclusive_client = APR_ARRAY_IDX(exclusive_clients, i,
+ const char *);
+
+ /* This blocks other clients from accessing the wc.db so it must
+ be explicitly enabled.*/
+ if (!strcmp(exclusive_client, "svn"))
+ svn_config_set(cfg_config,
+ SVN_CONFIG_SECTION_WORKING_COPY,
+ SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE,
+ "true");
+ }
}
#endif