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