You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Shlomi Fish <sh...@vipe.stud.technion.ac.il> on 2003/07/24 08:17:24 UTC

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

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

Regards,

	Shlomi Fish

<<<
Added a --config-dir option to svn to override the configuration directory
with a new per-session parameter.

* subversion/svnadmin/main.c
  Added the svnadmin__config_dir option and configured it for all the
  options.
  (main): Added the processing of the config_dir option.
  (subcommand_create): added the config_dir param to svn_config_get_config

* svn_config.h
  Modified the declaration and documentation of svn_config_get_config
  to accept an overriding config_dir parameter. Ditto for svn_config_ensure
  , svn_config_read_auth_data and svn_config_write_auth_data.

* svn_auth.h
  Added the SVN_AUTH_PARAM_CONFIG_DIR parameter.

* subversion/libsvn_wc/log.c
  Removed the call to svn_config_get_config which seems like a leftover
  from ancient times.

* subversion/libsvn_subr/config_file.c
  (svn_config__user_config_path): added the config_dir parameter.
  (svn_config_ensure): added the config_dir parameter.

* subversion/libsvn_subr/config.c
  (get_category_config): added the config_dir param and made it override
  the other directories in case it is set.
  (svn_config_get_config): added the config_dir param and passed it to
  get_category_config

* subversion/libsvn_subr/config_auth.c
  (auth_file_path): added the config_dir param.
  (svn_config_read_auth_data): added and implemented the config_dir param.
  (svn_config_write_auth_data): added and implemented the config_dir param.

* subversion/libsvn_subr/config_impl.h
  Added the config_dir parameter to svn_config__user_config_path

* subversion/libsvn_client/providers.c
  (get_creds): read the config_dir from the parameters and passed it to
  read_auth_data.
  (save_creds): added the config_dir param and passed it to
  write_auth_data.
  (simple_save_creds): read the config_dir from the parameters
  and passed it to save_creds.
  (username_save_creds): read the config_dir from the parameters
  and passed it to save_creds.

* subversion/clients/cmdline/cl.h
  Added the svn_cl__config_dir_opt option.
  Added the config_dir parameter to the opt_state structure.

* subversion/clients/cmdline/main.c
  Added the config-dir option to the command line processing, and enabled
  it in all sub-commands.
  (main): Added processing of the svn_cl__config_dir_opt; passed
  config_dir to svn_config_get_config and set its paramter in svn_auth.
>>>


----------------------------------------------------------------------
Shlomi Fish        shlomif@vipe.technion.ac.il
Home Page:         http://t2.technion.ac.il/~shlomif/

An apple a day will keep a doctor away. Two apples a day will keep two
doctors away.

	Falk Fish

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

Posted by Sander Roobol <ph...@wanadoo.nl>.
On Thu, Jul 24, 2003 at 11:32:51AM +0300, Shlomi Fish wrote:
> 
> Oops! I did not update the tests help messages dump. The up-to-date patch
> and log can be found here:
> 
> http://t2.technion.ac.il/~shlomif/svn-patches/add-config-dir-rev2.patch.txt
> http://t2.technion.ac.il/~shlomif/svn-patches/add-config-dir-rev2.log.txt

Filed as issue #1458.

Sander

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by Shlomi Fish <sh...@vipe.stud.technion.ac.il>.
Oops! I did not update the tests help messages dump. The up-to-date patch
and log can be found here:

http://t2.technion.ac.il/~shlomif/svn-patches/add-config-dir-rev2.patch.txt
http://t2.technion.ac.il/~shlomif/svn-patches/add-config-dir-rev2.log.txt

Regards,

	Shlomi Fish



----------------------------------------------------------------------
Shlomi Fish        shlomif@vipe.technion.ac.il
Home Page:         http://t2.technion.ac.il/~shlomif/

An apple a day will keep a doctor away. Two apples a day will keep two
doctors away.

	Falk Fish

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by Philip Martin <ph...@codematters.co.uk>.
Shlomi Fish <sh...@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