Author: philip
Date: Mon Oct 15 17:09:01 2012
New Revision: 1398389

URL: http://svn.apache.org/viewvc?rev=1398389&view=rev
Log:
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.

* 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.

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/include/svn_config.h
    subversion/trunk/subversion/libsvn_client/ctx.c
    subversion/trunk/subversion/libsvn_subr/config_file.c
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h
    subversion/trunk/subversion/libsvn_wc/wc_db_private.h
    subversion/trunk/subversion/libsvn_wc/wc_db_util.c
    subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c
    subversion/trunk/subversion/svn/main.c
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/trunk/subversion/tests/libsvn_wc/utils.c

Modified: subversion/trunk/subversion/include/svn_client.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Mon Oct 15 17:09:01 2012
@@ -999,6 +999,18 @@ typedef struct svn_client_ctx_t
  *
  * The current implementation never returns error, but callers should
  * still check for error, for compatibility with future versions.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_client_create_context2(svn_client_ctx_t **ctx,
+                           apr_hash_t *cfg_hash,
+                           apr_pool_t *pool);
+
+
+/** Similar to svn_client_create_context but passes a NULL @a cfg_hash.
+ *
+ * @deprecated Provided for backward compatibility with the 1.7 API.
  */
 svn_error_t *
 svn_client_create_context(svn_client_ctx_t **ctx,

Modified: subversion/trunk/subversion/include/svn_config.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_config.h?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_config.h (original)
+++ subversion/trunk/subversion/include/svn_config.h Mon Oct 15 17:09:01 2012
@@ -118,6 +118,10 @@ typedef struct svn_config_t svn_config_t
 #define SVN_CONFIG_OPTION_MEMORY_CACHE_SIZE         "memory-cache-size"
 #define SVN_CONFIG_SECTION_TUNNELS              "tunnels"
 #define SVN_CONFIG_SECTION_AUTO_PROPS           "auto-props"
+/** @since New in 1.8. */
+#define SVN_CONFIG_SECTION_WORKING_COPY         "working-copy"
+/** @since New in 1.8. */
+#define SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE      "exclusive-locking"
 /** @} */
 
 /** @name Repository conf directory configuration files strings

Modified: subversion/trunk/subversion/libsvn_client/ctx.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/ctx.c?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/ctx.c (original)
+++ subversion/trunk/subversion/libsvn_client/ctx.c Mon Oct 15 17:09:01 2012
@@ -76,9 +76,12 @@ call_conflict_func(svn_wc_conflict_resul
 }
 
 svn_error_t *
-svn_client_create_context(svn_client_ctx_t **ctx,
-                          apr_pool_t *pool)
+svn_client_create_context2(svn_client_ctx_t **ctx,
+                           apr_hash_t *cfg_hash,
+                           apr_pool_t *pool)
 {
+  svn_config_t *cfg_config;
+                                   
   *ctx = apr_pcalloc(pool, sizeof(svn_client_ctx_t));
 
   (*ctx)->notify_func2 = call_notify_func;
@@ -87,8 +90,23 @@ svn_client_create_context(svn_client_ctx
   (*ctx)->conflict_func2 = call_conflict_func;
   (*ctx)->conflict_baton2 = *ctx;
 
-  SVN_ERR(svn_wc_context_create(&(*ctx)->wc_ctx, NULL /* config */, pool,
+  (*ctx)->config = cfg_hash;
+
+  if (cfg_hash)
+    cfg_config = apr_hash_get(cfg_hash, SVN_CONFIG_CATEGORY_CONFIG,
+                              APR_HASH_KEY_STRING);
+  else
+    cfg_config = NULL;
+
+  SVN_ERR(svn_wc_context_create(&(*ctx)->wc_ctx, cfg_config, pool,
                                 pool));
 
   return SVN_NO_ERROR;
 }
+
+svn_error_t *
+svn_client_create_context(svn_client_ctx_t **ctx,
+                          apr_pool_t *pool)
+{
+  return svn_client_create_context2(ctx, NULL, pool);
+}

Modified: subversion/trunk/subversion/libsvn_subr/config_file.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config_file.c?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/config_file.c (original)
+++ subversion/trunk/subversion/libsvn_subr/config_file.c Mon Oct 15 17:09:01 
2012
@@ -1160,7 +1160,12 @@ svn_config_ensure(const char *config_dir
         "# *.png = svn:mime-type=image/png"                                  NL
         "# *.jpg = svn:mime-type=image/jpeg"                                 NL
         "# Makefile = svn:eol-style=native"                                  NL
-        ""                                                                   
NL;
+        ""                                                                   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
+        "# exclusive-locking = false"                                        
NL;
 
       err = svn_io_file_open(&f, path,
                              (APR_WRITE | APR_CREATE | APR_EXCL),

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Mon Oct 15 17:09:01 
2012
@@ -1040,6 +1040,9 @@ FROM nodes_current n
 WHERE (wc_id = ?1 AND local_relpath = ?2)
    OR (wc_id = ?1 AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
 
+-- STMT_PRAGA_LOCKING_MODE
+PRAGMA locking_mode = exclusive
+
 /* ------------------------------------------------------------------------- */
 
 /* these are used in entries.c  */

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Oct 15 17:09:01 2012
@@ -1508,13 +1508,14 @@ create_db(svn_sqlite__db_t **sdb,
           const char *root_node_repos_relpath,
           svn_revnum_t root_node_revision,
           svn_depth_t root_node_depth,
+          svn_boolean_t exclusive,
           apr_pool_t *result_pool,
           apr_pool_t *scratch_pool)
 {
   struct init_db_baton idb;
 
   SVN_ERR(svn_wc__db_util_open_db(sdb, dir_abspath, sdb_fname,
-                                  svn_sqlite__mode_rwcreate,
+                                  svn_sqlite__mode_rwcreate, exclusive,
                                   NULL /* my_statements */,
                                   result_pool, scratch_pool));
 
@@ -1547,6 +1548,7 @@ svn_wc__db_init(svn_wc__db_t *db,
   apr_int64_t repos_id;
   apr_int64_t wc_id;
   svn_wc__db_wcroot_t *wcroot;
+  svn_boolean_t sqlite_exclusive = FALSE;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
   SVN_ERR_ASSERT(repos_relpath != NULL);
@@ -1557,10 +1559,15 @@ svn_wc__db_init(svn_wc__db_t *db,
 
   /* ### REPOS_ROOT_URL and REPOS_UUID may be NULL. ... more doc: tbd  */
 
+  SVN_ERR(svn_config_get_bool((svn_config_t *)db->config, &sqlite_exclusive,
+                              SVN_CONFIG_SECTION_WORKING_COPY,
+                              SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE,
+                              FALSE));
+
   /* Create the SDB and insert the basic rows.  */
   SVN_ERR(create_db(&sdb, &repos_id, &wc_id, local_abspath, repos_root_url,
                     repos_uuid, SDB_FILE, 
-                    repos_relpath, initial_rev, depth,
+                    repos_relpath, initial_rev, depth, sqlite_exclusive,
                     db->state_pool, scratch_pool));
 
   /* Create the WCROOT for this directory.  */
@@ -11498,10 +11505,13 @@ svn_wc__db_upgrade_begin(svn_sqlite__db_
                          apr_pool_t *scratch_pool)
 {
   svn_wc__db_wcroot_t *wcroot;
+
+  /* Upgrade is inherently exclusive so specify exclusive locking. */
   SVN_ERR(create_db(sdb, repos_id, wc_id, dir_abspath,
                     repos_root_url, repos_uuid,
                     SDB_FILE,
                     NULL, SVN_INVALID_REVNUM, svn_depth_unknown,
+                    TRUE /* exclusive */,
                     wc_db->state_pool, scratch_pool));
 
   SVN_ERR(svn_wc__db_pdh_create_wcroot(&wcroot,

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Mon Oct 15 17:09:01 2012
@@ -255,7 +255,7 @@ typedef struct svn_wc__db_lock_t {
 */
 svn_error_t *
 svn_wc__db_open(svn_wc__db_t **db,
-                const svn_config_t *config,
+                svn_config_t *config,
                 svn_boolean_t auto_upgrade,
                 svn_boolean_t enforce_empty_wq,
                 apr_pool_t *result_pool,

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_private.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_private.h?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_private.h Mon Oct 15 17:09:01 
2012
@@ -36,7 +36,7 @@
 struct svn_wc__db_t {
   /* We need the config whenever we run into a new WC directory, in order
      to figure out where we should look for the corresponding datastore. */
-  const svn_config_t *config;
+  svn_config_t *config;
 
   /* Should we attempt to automatically upgrade the database when it is
      opened, and found to be not-current?  */
@@ -170,6 +170,7 @@ svn_wc__db_util_open_db(svn_sqlite__db_t
                         const char *dir_abspath,
                         const char *sdb_fname,
                         svn_sqlite__mode_t smode,
+                        svn_boolean_t exclusive,
                         const char *const *my_statements,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool);

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_util.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_util.c?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_util.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_util.c Mon Oct 15 17:09:01 2012
@@ -114,6 +114,7 @@ svn_wc__db_util_open_db(svn_sqlite__db_t
                         const char *dir_abspath,
                         const char *sdb_fname,
                         svn_sqlite__mode_t smode,
+                        svn_boolean_t exclusive,
                         const char *const *my_statements,
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool)
@@ -140,6 +141,9 @@ svn_wc__db_util_open_db(svn_sqlite__db_t
                            my_statements ? my_statements : statements,
                            0, NULL, result_pool, scratch_pool));
 
+  if (exclusive)
+    SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_PRAGA_LOCKING_MODE));
+
   SVN_ERR(svn_sqlite__create_scalar_function(*sdb, "relpath_depth", 1,
                                              relpath_depth, NULL));
 

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_wcroot.c Mon Oct 15 17:09:01 
2012
@@ -186,7 +186,7 @@ close_wcroot(void *data)
 
 svn_error_t *
 svn_wc__db_open(svn_wc__db_t **db,
-                const svn_config_t *config,
+                svn_config_t *config,
                 svn_boolean_t auto_upgrade,
                 svn_boolean_t enforce_empty_wq,
                 apr_pool_t *result_pool,
@@ -508,6 +508,18 @@ svn_wc__db_wcroot_parse_local_abspath(sv
 
       if (adm_subdir_kind == svn_node_dir)
         {
+          svn_boolean_t sqlite_exclusive = FALSE;
+
+          err = svn_config_get_bool(db->config, &sqlite_exclusive,
+                                    SVN_CONFIG_SECTION_WORKING_COPY,
+                                    SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE,
+                                    FALSE);
+          if (err)
+            {
+              svn_error_clear(err);
+              sqlite_exclusive = FALSE;
+            }
+
           /* We always open the database in read/write mode.  If the database
              isn't writable in the filesystem, SQLite will internally open
              it as read-only, and we'll get an error if we try to do a write
@@ -517,7 +529,8 @@ svn_wc__db_wcroot_parse_local_abspath(sv
              we're caching database handles, it make sense to be as permissive
              as the filesystem allows. */
           err = svn_wc__db_util_open_db(&sdb, local_abspath, SDB_FILE,
-                                        svn_sqlite__mode_readwrite, NULL,
+                                        svn_sqlite__mode_readwrite,
+                                        sqlite_exclusive, NULL,
                                         db->state_pool, scratch_pool);
           if (err == NULL)
             {
@@ -731,6 +744,9 @@ try_symlink_as_dir:
             {
               SVN_ERR(read_link_target(&local_abspath, original_abspath,
                                        scratch_pool));
+              /* This handle was opened in this function but is not going
+                 to be used further so close it. */
+              SVN_ERR(svn_sqlite__close(sdb));
               goto try_symlink_as_dir;
             }
         }

Modified: subversion/trunk/subversion/svn/main.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/main.c?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/main.c (original)
+++ subversion/trunk/subversion/svn/main.c Mon Oct 15 17:09:01 2012
@@ -1663,6 +1663,8 @@ sub_main(int argc, const char *argv[], a
   svn_boolean_t interactive_conflicts = FALSE;
   svn_boolean_t use_notifier = TRUE;
   apr_hash_t *changelists;
+  const char *sqlite_exclusive;
+  apr_hash_t *cfg_hash;
 
   received_opts = apr_array_make(pool, SVN_OPT_MAX_OPTIONS, sizeof(int));
 
@@ -2384,14 +2386,111 @@ sub_main(int argc, const char *argv[], a
   opt_state.end_revision = APR_ARRAY_IDX(opt_state.revision_ranges, 0,
                                          svn_opt_revision_range_t *)->end;
 
+  err = svn_config_get_config(&cfg_hash, opt_state.config_dir, pool);
+  if (err)
+    {
+      /* Fallback to default config if the config directory isn't readable
+         or is not a directory. */
+      if (APR_STATUS_IS_EACCES(err->apr_err)
+          || SVN__APR_STATUS_IS_ENOTDIR(err->apr_err))
+        {
+          svn_handle_warning2(stderr, err, "svn: ");
+          svn_error_clear(err);
+          cfg_hash = NULL;
+        }
+      else
+        return EXIT_ERROR(err);
+    }
+
   /* Create a client context object. */
   command_baton.opt_state = &opt_state;
-  SVN_INT_ERR(svn_client_create_context(&ctx, pool));
+  SVN_INT_ERR(svn_client_create_context2(&ctx, cfg_hash, pool));
   command_baton.ctx = ctx;
 
+  /* Relocation is infinite-depth only. */
+  if (opt_state.relocate)
+    {
+      if (opt_state.depth != svn_depth_unknown)
+        {
+          err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                                 _("--relocate and --depth are mutually "
+                                   "exclusive"));
+          return EXIT_ERROR(err);
+        }
+      if (! descend)
+        {
+          err = svn_error_create(
+                    SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
+                    _("--relocate and --non-recursive (-N) are mutually "
+                      "exclusive"));
+          return EXIT_ERROR(err);
+        }
+    }
+
+  /* Only a few commands can accept a revision range; the rest can take at
+     most one revision number. */
+  if (subcommand->cmd_func != svn_cl__blame
+      && subcommand->cmd_func != svn_cl__diff
+      && subcommand->cmd_func != svn_cl__log
+      && subcommand->cmd_func != svn_cl__mergeinfo
+      && subcommand->cmd_func != svn_cl__merge)
+    {
+      if (opt_state.end_revision.kind != svn_opt_revision_unspecified)
+        {
+          err = svn_error_create(SVN_ERR_CLIENT_REVISION_RANGE, NULL, NULL);
+          return EXIT_ERROR(err);
+        }
+    }
+
+  /* -N has a different meaning depending on the command */
+  if (descend == FALSE)
+    {
+      if (subcommand->cmd_func == svn_cl__status)
+        {
+          opt_state.depth = svn_depth_immediates;
+        }
+      else if (subcommand->cmd_func == svn_cl__revert
+               || subcommand->cmd_func == svn_cl__add
+               || subcommand->cmd_func == svn_cl__commit)
+        {
+          /* In pre-1.5 Subversion, some commands treated -N like
+             --depth=empty, so force that mapping here.  Anyway, with
+             revert it makes sense to be especially conservative,
+             since revert can lose data. */
+          opt_state.depth = svn_depth_empty;
+        }
+      else
+        {
+          opt_state.depth = svn_depth_files;
+        }
+    }
+
+  cfg_config = apr_hash_get(ctx->config, SVN_CONFIG_CATEGORY_CONFIG,
+                            APR_HASH_KEY_STRING);
+
+  /* Update the options in the config */
+  if (opt_state.config_options)
+    {
+      svn_error_clear(
+          svn_cmdline__apply_config_options(ctx->config,
+                                            opt_state.config_options,
+                                            "svn: ", "--config-option"));
+    }
+
+  svn_config_get(cfg_config, &sqlite_exclusive,
+                 SVN_CONFIG_SECTION_WORKING_COPY,
+                 SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE,
+                 NULL);
+  if (!sqlite_exclusive)
+    svn_config_set(cfg_config,
+                   SVN_CONFIG_SECTION_WORKING_COPY,
+                   SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE,
+                   "true");
+
   /* If we're running a command that could result in a commit, verify
      that any log message we were given on the command line makes
-     sense (unless we've also been instructed not to care). */
+     sense (unless we've also been instructed not to care).  This may
+     access the working copy so do it after setting the locking mode. */
   if ((! opt_state.force_log)
       && (subcommand->cmd_func == svn_cl__commit
           || subcommand->cmd_func == svn_cl__copy
@@ -2466,92 +2565,6 @@ sub_main(int argc, const char *argv[], a
         }
     }
 
-  /* Relocation is infinite-depth only. */
-  if (opt_state.relocate)
-    {
-      if (opt_state.depth != svn_depth_unknown)
-        {
-          err = svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
-                                 _("--relocate and --depth are mutually "
-                                   "exclusive"));
-          return EXIT_ERROR(err);
-        }
-      if (! descend)
-        {
-          err = svn_error_create(
-                    SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
-                    _("--relocate and --non-recursive (-N) are mutually "
-                      "exclusive"));
-          return EXIT_ERROR(err);
-        }
-    }
-
-  /* Only a few commands can accept a revision range; the rest can take at
-     most one revision number. */
-  if (subcommand->cmd_func != svn_cl__blame
-      && subcommand->cmd_func != svn_cl__diff
-      && subcommand->cmd_func != svn_cl__log
-      && subcommand->cmd_func != svn_cl__mergeinfo
-      && subcommand->cmd_func != svn_cl__merge)
-    {
-      if (opt_state.end_revision.kind != svn_opt_revision_unspecified)
-        {
-          err = svn_error_create(SVN_ERR_CLIENT_REVISION_RANGE, NULL, NULL);
-          return EXIT_ERROR(err);
-        }
-    }
-
-  /* -N has a different meaning depending on the command */
-  if (descend == FALSE)
-    {
-      if (subcommand->cmd_func == svn_cl__status)
-        {
-          opt_state.depth = svn_depth_immediates;
-        }
-      else if (subcommand->cmd_func == svn_cl__revert
-               || subcommand->cmd_func == svn_cl__add
-               || subcommand->cmd_func == svn_cl__commit)
-        {
-          /* In pre-1.5 Subversion, some commands treated -N like
-             --depth=empty, so force that mapping here.  Anyway, with
-             revert it makes sense to be especially conservative,
-             since revert can lose data. */
-          opt_state.depth = svn_depth_empty;
-        }
-      else
-        {
-          opt_state.depth = svn_depth_files;
-        }
-    }
-
-  err = svn_config_get_config(&(ctx->config),
-                              opt_state.config_dir, pool);
-  if (err)
-    {
-      /* Fallback to default config if the config directory isn't readable
-         or is not a directory. */
-      if (APR_STATUS_IS_EACCES(err->apr_err)
-          || SVN__APR_STATUS_IS_ENOTDIR(err->apr_err))
-        {
-          svn_handle_warning2(stderr, err, "svn: ");
-          svn_error_clear(err);
-        }
-      else
-        return EXIT_ERROR(err);
-    }
-
-  cfg_config = apr_hash_get(ctx->config, SVN_CONFIG_CATEGORY_CONFIG,
-                            APR_HASH_KEY_STRING);
-
-  /* Update the options in the config */
-  if (opt_state.config_options)
-    {
-      svn_error_clear(
-          svn_cmdline__apply_config_options(ctx->config,
-                                            opt_state.config_options,
-                                            "svn: ", "--config-option"));
-    }
-
   /* XXX: Only diff_cmd for now, overlay rest later and stop passing
      opt_state altogether? */
   if (opt_state.diff.diff_cmd)

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Mon Oct 15 
17:09:01 2012
@@ -78,7 +78,8 @@ open_wc_db(svn_sqlite__db_t **sdb,
            apr_pool_t *scratch_pool)
 {
   SVN_ERR(svn_wc__db_util_open_db(sdb, wc_root_abspath, "wc.db",
-                                  svn_sqlite__mode_readwrite, my_statements,
+                                  svn_sqlite__mode_readwrite,
+                                  FALSE /* exclusive */, my_statements,
                                   result_pool, scratch_pool));
   return SVN_NO_ERROR;
 }

Modified: subversion/trunk/subversion/tests/libsvn_wc/utils.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/utils.c?rev=1398389&r1=1398388&r2=1398389&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/utils.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/utils.c Mon Oct 15 17:09:01 2012
@@ -133,7 +133,8 @@ svn_test__create_fake_wc(const char *wc_
 
   svn_error_clear(svn_io_remove_file2(db_abspath, FALSE, scratch_pool));
   SVN_ERR(svn_wc__db_util_open_db(&sdb, wc_abspath, "wc.db",
-                                  svn_sqlite__mode_rwcreate, my_statements,
+                                  svn_sqlite__mode_rwcreate,
+                                  FALSE /* exclusive */, my_statements,
                                   result_pool, scratch_pool));
   for (i = 0; my_statements[i] != NULL; i++)
     SVN_ERR(svn_sqlite__exec_statements(sdb, /* my_statements[] */ i));


Reply via email to