[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] --config-dir patch rev. 2

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-08-14 23:18:35 CEST

Shlomi Fish <shlomif@vipe.stud.technion.ac.il> writes:

> This time this patch is more encompassing and applies to other functions
> in svn_config.

I applied a modified version in revision 6735. Thanks!

I changed a few bits. Did you run the regression tests? The getopt
tests depend on the help text, which includes the new option...

> Index: subversion/libsvn_subr/config_file.c
> ===================================================================
> --- subversion/libsvn_subr/config_file.c (revision 6538)
> +++ subversion/libsvn_subr/config_file.c (working copy)
> @@ -285,7 +285,8 @@
>
>
> svn_error_t *
> -svn_config__user_config_path (const char **path_p,
> +svn_config__user_config_path (const char *config_dir,
> + const char **path_p,
> const char *fname,
> apr_pool_t *pool)
> {
> @@ -293,6 +294,12 @@
> prototype should change? */
>
> *path_p = NULL;
> +
> + if (config_dir)
> + {
> + *path_p = apr_pstrdup(pool, config_dir);

This bit ignored fname, which didn't seem right as it didn't work.

> + return SVN_NO_ERROR;
> + }
>
> /* Note that even if fname is null, svn_path_join_many will DTRT. */

> Index: subversion/libsvn_subr/config.c
> ===================================================================
> --- subversion/libsvn_subr/config.c (revision 6538)
> +++ subversion/libsvn_subr/config.c (working copy)
> @@ -186,6 +186,7 @@
>
> static svn_error_t *
> get_category_config (svn_config_t **cfg,
> + const char *config_dir,
> const char *category,
> apr_pool_t *pool)
> {
> @@ -202,11 +203,23 @@
> #endif /* SVN_WIN32 */
>
> SVN_ERR (svn_config__sys_config_path (&sys_cfg_path, category, pool));
> - SVN_ERR (svn_config__user_config_path (&usr_cfg_path, category, pool));
> - SVN_ERR (read_all (cfg,
> - sys_reg_path, usr_reg_path,
> - sys_cfg_path, usr_cfg_path,
> - pool));
> + SVN_ERR (svn_config__user_config_path (config_dir, &usr_cfg_path, category, pool));
> + /*
> + * If config_dir is specified it overrides all the other directories.
> + * */
> + if (config_dir)
> + {
> + SVN_ERR (read_all (cfg,
> + NULL, NULL, config_dir, NULL,
> + pool));
> + }
> + else
> + {
> + SVN_ERR (read_all (cfg,
> + sys_reg_path, usr_reg_path,
> + sys_cfg_path, usr_cfg_path,
> + pool));
> + }

I decided to make the config_dir parameter override the users config,
but continue to use the system config.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 14 23:39:09 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.