Checkout
philip
committed
on 15 Oct 12
Enable SQLite exclusive locking for the command line client as this is
a major performance gain for working copies on network disks. The
li… Show more
Enable SQLite exclusive locking for the command line client as this is

a major performance gain for working copies on network disks.  The

libraries default to shared locking for backward compatibility, the

command line client defaults to exclusive locking and a config setting

allows the user to override the command line client.

Addresses issue 4176.

* subversion/libsvn_wc/wc-queries.sql

 (STMT_PRAGA_LOCKING_MODE): New.

* subversion/libsvn_wc/wc_db.c

 (create_db): Add exclusive parameter.

 (svn_wc__db_init): Get exclusive setting from config.

 (svn_wc__db_upgrade_begin): Use exclusive locking.

* subversion/libsvn_wc/wc_db_private.h

 (struct svn_wc__db_t): Make config non-const.

 (svn_wc__db_util_open_db): Add exclusive parameter.

* subversion/libsvn_wc/wc_db_util.c

 (svn_wc__db_util_open_db): Add exclusive parameter.

* subversion/libsvn_wc/wc_db.h

 (svn_wc__db_open): Make config parameter non-const.

* subversion/libsvn_wc/wc_db_wcroot.c

 (svn_wc__db_open): Make config parameter non-const.

 (svn_wc__db_wcroot_parse_local_abspath): Get exclusive setting from

  config, close unused SQLite handle when following a symlink.

* subversion/include/svn_client.h

 (svn_client_create_context2): New.

 (svn_client_create_context): Deprecate.

* subversion/libsvn_client/ctx.c

 (svn_client_create_context2): Add config hash parameter, pass config

  to WC context.

 (svn_client_create_context): Call new version.

* subversion/include/svn_config.h

 (SVN_CONFIG_SECTION_WORKING_COPY,

  SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE): New.

* subversion/libsvn_subr/config_file.c

 (svn_config_ensure): Add [working-copy] section.

* subversion/svn/main.c

 (sub_main): Get config hash earlier, pass to client context, set

  exclusive locking if client does not already set it, move log

  message checking later.

* subversion/tests/libsvn_wc/utils.c

 (svn_test__create_fake_wc): Use shared locking.

* subversion/tests/libsvn_wc/op-depth-test.c

 (open_wc_db): Use shared locking.

Show less