Index: subversion/include/svn_io.h =================================================================== --- subversion/include/svn_io.h (revision 4738) +++ subversion/include/svn_io.h (working copy) @@ -33,6 +33,7 @@ #include "svn_types.h" #include "svn_error.h" #include "svn_string.h" +#include "svn_config.h" #ifdef __cplusplus extern "C" { @@ -547,6 +548,8 @@ * @a from is the first file passed to diff, and @a to is the second. The * stdout of diff will be sent to @a outfile, and the stderr to @a errfile. * + * @a cfg is the client's "config" options, or NULL if there are none. + * * Do all allocation in @a pool. */ svn_error_t *svn_io_run_diff (const char *dir, @@ -559,6 +562,7 @@ int *exitcode, apr_file_t *outfile, apr_file_t *errfile, + svn_config_t *cfg, apr_pool_t *pool); Index: subversion/include/svn_wc.h =================================================================== --- subversion/include/svn_wc.h (revision 4738) +++ subversion/include/svn_wc.h (working copy) @@ -929,6 +929,8 @@ * and its entries. Else if @a descend is true, @a statushash will contain * statuses for @a path and everything below it, including * subdirectories. In other words, a full recursion. + * + * @a cfg is the "default" config for the client. */ svn_error_t *svn_wc_statuses (apr_hash_t *statushash, const char *path, @@ -938,6 +940,7 @@ svn_boolean_t no_ignore, svn_wc_notify_func_t notify_func, void *notify_baton, + svn_config_t *cfg, apr_pool_t *pool); Index: subversion/include/svn_client.h =================================================================== --- subversion/include/svn_client.h (revision 4738) +++ subversion/include/svn_client.h (working copy) @@ -268,6 +268,12 @@ /** log message callback baton */ void *log_msg_baton; + /** a hash mapping of const char * configuration file names to + * @c svn_config_t *'s. for example, the '~/.subversion/config' file's + * contents should have the key "config". + */ + apr_hash_t *config; + } svn_client_ctx_t; Index: subversion/include/svn_ra.h =================================================================== --- subversion/include/svn_ra.h (revision 4738) +++ subversion/include/svn_ra.h (working copy) @@ -382,6 +382,10 @@ * @a callbacks/@a callback_baton is a table of callbacks provided by the * client; see @c svn_ra_callbacks_t above. * + * @a config is a hash mapping const char * keys to + * @c svn_config_t * values. For example, the @c svn_config_t for the + * "~/.subversion/config" file is under the key "config". + * * All RA requests require a @a session_baton; they will continue to * use @a pool for memory allocation. */ @@ -389,6 +393,7 @@ const char *repos_URL, const svn_ra_callbacks_t *callbacks, void *callback_baton, + apr_hash_t *config, apr_pool_t *pool); /** Close a repository session. Index: subversion/libsvn_wc/status.c =================================================================== --- subversion/libsvn_wc/status.c (revision 4738) +++ subversion/libsvn_wc/status.c (working copy) @@ -40,9 +40,9 @@ in *PATTERNS. Allocate *PATTERNS and its contents in POOL. */ static svn_error_t * get_default_ignores (apr_array_header_t **patterns, + svn_config_t *cfg, apr_pool_t *pool) { - struct svn_config_t *cfg; const char *val; /* Check the Subversion run-time configuration for global ignores. @@ -543,6 +543,7 @@ svn_boolean_t no_ignore, svn_wc_notify_func_t notify_func, void *notify_baton, + svn_config_t *cfg, apr_pool_t *pool) { apr_hash_t *entries; @@ -554,7 +555,7 @@ SVN_ERR (svn_wc_entries_read (&entries, adm_access, FALSE, pool)); /* Read the default ignores from the config files. */ - SVN_ERR (get_default_ignores (&ignores, pool)); + SVN_ERR (get_default_ignores (&ignores, cfg, pool)); /* Add the unversioned items to the status output. */ SVN_ERR (add_unversioned_items (path, adm_access, entries, statushash, @@ -639,7 +640,7 @@ SVN_ERR (get_dir_status (statushash, fullpath, dir_entry, dir_access, descend, get_all, no_ignore, notify_func, - notify_baton, pool)); + notify_baton, cfg, pool)); } } else @@ -665,6 +666,7 @@ svn_boolean_t no_ignore, svn_wc_notify_func_t notify_func, void *notify_baton, + svn_config_t *cfg, apr_pool_t *pool) { svn_node_kind_t kind; @@ -732,7 +734,7 @@ SVN_ERR (get_dir_status(statushash, path, parent_entry, adm_access, descend, get_all, no_ignore, notify_func, notify_baton, - pool)); + cfg, pool)); } return SVN_NO_ERROR; Index: subversion/libsvn_subr/io.c =================================================================== --- subversion/libsvn_subr/io.c (revision 4738) +++ subversion/libsvn_subr/io.c (working copy) @@ -1117,6 +1117,7 @@ int *pexitcode, apr_file_t *outfile, apr_file_t *errfile, + svn_config_t *cfg, apr_pool_t *pool) { const char **args; @@ -1127,9 +1128,7 @@ apr_pool_t *subpool = svn_pool_create (pool); - svn_config_t *cfg; const char *diff_cmd; - SVN_ERR (svn_config_read_config (&cfg, subpool)); svn_config_get (cfg, &diff_cmd, "helpers", "diff-cmd", SVN_CLIENT_DIFF); if (pexitcode == NULL) Index: subversion/libsvn_ra_local/ra_plugin.c =================================================================== --- subversion/libsvn_ra_local/ra_plugin.c (revision 4738) +++ subversion/libsvn_ra_local/ra_plugin.c (working copy) @@ -200,6 +200,7 @@ const char *repos_URL, const svn_ra_callbacks_t *callbacks, void *callback_baton, + apr_hash_t *config, apr_pool_t *pool) { svn_ra_local__session_baton_t *session; Index: subversion/libsvn_client/delete.c =================================================================== --- subversion/libsvn_client/delete.c (revision 4738) +++ subversion/libsvn_client/delete.c (working copy) @@ -38,6 +38,7 @@ svn_error_t * svn_client__can_delete (const char *path, svn_wc_adm_access_t *adm_access, + svn_client_ctx_t *ctx, apr_pool_t *pool) { apr_hash_t *hash = apr_hash_make (pool); @@ -51,8 +52,14 @@ else dir_access = adm_access; - SVN_ERR (svn_wc_statuses (hash, path, dir_access, TRUE, FALSE, FALSE, - NULL, NULL, pool)); + { + svn_config_t *cfg = apr_hash_get (ctx->config, "config", + APR_HASH_KEY_STRING); + + SVN_ERR (svn_wc_statuses (hash, path, dir_access, TRUE, FALSE, FALSE, + NULL, NULL, cfg, pool)); + } + for (hi = apr_hash_first (pool, hash); hi; hi = apr_hash_next (hi)) { const void *key; @@ -209,7 +216,7 @@ if (!force) { /* Verify that there are no "awkward" files */ - SVN_ERR (svn_client__can_delete (path, adm_access, pool)); + SVN_ERR (svn_client__can_delete (path, adm_access, ctx, pool)); } /* Mark the entry for commit deletion and perform wc deletion */ Index: subversion/libsvn_client/ra.c =================================================================== --- subversion/libsvn_client/ra.c (revision 4738) +++ subversion/libsvn_client/ra.c (working copy) @@ -284,7 +284,8 @@ be enough? */ } - SVN_ERR (ra_lib->open (session_baton, base_url, cbtable, cb, pool)); + SVN_ERR (ra_lib->open (session_baton, base_url, cbtable, cb, ctx->config, + pool)); return SVN_NO_ERROR; } Index: subversion/libsvn_client/diff.c =================================================================== --- subversion/libsvn_client/diff.c (revision 4738) +++ subversion/libsvn_client/diff.c (working copy) @@ -148,6 +148,8 @@ */ svn_revnum_t revnum1; svn_revnum_t revnum2; + + svn_client_ctx_t *ctx; }; @@ -255,9 +257,14 @@ label2 = diff_label (path, rev2, subpool); } - SVN_ERR (svn_io_run_diff (".", args, nargs, label1, label2, - tmpfile1, tmpfile2, - &exitcode, outfile, errfile, subpool)); + { + svn_config_t *cfg = apr_hash_get (diff_cmd_baton->ctx->config, "config", + APR_HASH_KEY_STRING); + + SVN_ERR (svn_io_run_diff (".", args, nargs, label1, label2, + tmpfile1, tmpfile2, + &exitcode, outfile, errfile, cfg, subpool)); + } /* ### todo: Handle exit code == 2 (i.e. errors with diff) here */ @@ -1348,6 +1355,8 @@ diff_cmd_baton.errfile = errfile; diff_cmd_baton.revnum1 = SVN_INVALID_REVNUM; diff_cmd_baton.revnum2 = SVN_INVALID_REVNUM; + + diff_cmd_baton.ctx = ctx; if ((svn_path_is_url (path1)) != (svn_path_is_url (path2))) return svn_error_create Index: subversion/libsvn_client/copy.c =================================================================== --- subversion/libsvn_client/copy.c (revision 4738) +++ subversion/libsvn_client/copy.c (working copy) @@ -129,7 +129,7 @@ if (!force) /* Ensure there are no "awkward" files. */ - SVN_ERR_W (svn_client__can_delete (src_path, src_access, pool), + SVN_ERR_W (svn_client__can_delete (src_path, src_access, ctx, pool), "Pass --force to override this restriction"); } else if (! optional_adm_access) Index: subversion/libsvn_client/status.c =================================================================== --- subversion/libsvn_client/status.c (revision 4738) +++ subversion/libsvn_client/status.c (working copy) @@ -162,9 +162,15 @@ /* Ask the wc to give us a list of svn_wc_status_t structures. These structures contain nothing but information found in the working copy. */ - SVN_ERR (svn_wc_statuses (hash, path, adm_access, - descend, get_all, no_ignore, - ctx->notify_func, ctx->notify_baton, pool)); + { + svn_config_t *cfg = apr_hash_get (ctx->config, "config", + APR_HASH_KEY_STRING); + + SVN_ERR (svn_wc_statuses (hash, path, adm_access, + descend, get_all, no_ignore, + ctx->notify_func, ctx->notify_baton, + cfg, pool)); + } if (update) { Index: subversion/libsvn_client/client.h =================================================================== --- subversion/libsvn_client/client.h (revision 4738) +++ subversion/libsvn_client/client.h (working copy) @@ -225,9 +225,11 @@ /* Verify that the path can be deleted without losing stuff, i.e. ensure that there are no modified or unversioned resources under PATH. This is - similar to checking the output of the status command. */ + similar to checking the output of the status command. CTX is the client's + context. */ svn_error_t * svn_client__can_delete (const char *path, svn_wc_adm_access_t *adm_access, + svn_client_ctx_t *ctx, apr_pool_t *pool); /* ---------------------------------------------------------------- */ Index: subversion/svnlook/main.c =================================================================== --- subversion/svnlook/main.c (revision 4738) +++ subversion/svnlook/main.c (working copy) @@ -659,9 +659,16 @@ label = apr_psprintf (pool, "%s\t(original)", base_path); SVN_ERR (svn_path_get_absolute (&abs_path, orig_path, pool)); - SVN_ERR (svn_io_run_diff (SVNLOOK_TMPDIR, NULL, 0, label, NULL, - abs_path, path, - &exitcode, outhandle, NULL, pool)); + + { + svn_config_t *cfg; + + SVN_ERR (svn_config_read_config (&cfg, pool)); + + SVN_ERR (svn_io_run_diff (SVNLOOK_TMPDIR, NULL, 0, label, NULL, + abs_path, path, + &exitcode, outhandle, NULL, cfg, pool)); + } /* TODO: Handle exit code == 2 (i.e. diff error) here. */ } Index: subversion/clients/cmdline/main.c =================================================================== --- subversion/clients/cmdline/main.c (revision 4738) +++ subversion/clients/cmdline/main.c (working copy) @@ -928,6 +928,24 @@ ctx.log_msg_func = svn_cl__get_log_message; ctx.log_msg_baton = svn_cl__make_log_msg_baton (&opt_state, NULL, pool); + ctx.config = apr_hash_make (pool); + + { + svn_config_t *cfg; + + err = svn_config_read_config (&cfg, pool); + if (err) + svn_handle_error (err, stderr, 0); + else + apr_hash_set (ctx.config, "config", APR_HASH_KEY_STRING, cfg); + + err = svn_config_read_servers (&cfg, pool); + if (err) + svn_handle_error (err, stderr, 0); + else + apr_hash_set (ctx.config, "servers", APR_HASH_KEY_STRING, cfg); + } + err = (*subcommand->cmd_func) (os, &command_baton, pool); if (err) { Index: subversion/libsvn_ra_svn/client.c =================================================================== --- subversion/libsvn_ra_svn/client.c (revision 4738) +++ subversion/libsvn_ra_svn/client.c (working copy) @@ -281,6 +281,7 @@ static svn_error_t *ra_svn_open(void **sess, const char *url, const svn_ra_callbacks_t *callbacks, void *callback_baton, + apr_hash_t *config, apr_pool_t *pool) { svn_ra_svn_conn_t *conn; Index: subversion/libsvn_ra_dav/session.c =================================================================== --- subversion/libsvn_ra_dav/session.c (revision 4738) +++ subversion/libsvn_ra_dav/session.c (working copy) @@ -293,6 +293,7 @@ const char *repos_URL, const svn_ra_callbacks_t *callbacks, void *callback_baton, + apr_hash_t *config, apr_pool_t *pool) { apr_size_t len;