/[Apache-SVN]
ViewVC logotype

Revision 1380608


Jump to revision: Previous Next
Author: stsp
Date: Tue Sep 4 12:43:40 2012 UTC (12 years, 3 months ago)
Changed paths: 10
Log Message:
Fix issue #4113, "convert SVNHooksEnv and svnserve.conf[hooks-env] to
use a common configuration files".

The hook environment is now specified in a separate configuration file.
By default, the file is searched for at 'conf/hooks-env' in the repository,
and read if it exists. The mod_dav_svn SVNHooksEnv and svnserve hooks-env
options may now be used to change file's the default location, e.g. to share
a single hooks environment configuration between multiple repositories.

* subversion/include/svn_config.h
  (SVN_CONFIG_SECTION_HOOKS_ENV): Remove, replaced by...
  (SVN_CONFIG_OPTION_HOOKS_ENV): ... this.

* subversion/include/svn_repos.h
  (svn_repos_hooks_setenv): Update declaration (see below for semantic
   changes).

* subversion/libsvn_ra_local/split_url.c
  (svn_ra_local__split_URL): Configure hook script environment. This finally
   allows RA-local clients to support the hook script environment feature.
   RA-local client always use the default configuration file location.

* subversion/libsvn_repos/hooks.c
  (run_hook_cmd): Choose the hook environment to use from the caller-provided
   hooks environment hash. Use either a hook-specific environment, or the
   default environment, if defined.

* subversion/libsvn_repos/repos.c
  (create_conf): Create a hooks-env configuration file template. Change the
   hooks-env example in svnserve.conf -- 'hooks-env' is now an option, not
   a section of options.
  (parse_hooks_env_option_baton parse_hooks_env_option,
   parse_hooks_env_section_baton, parse_hooks_env_section,
   parse_hooks_env): New set of functions/batons to parse the hooks-env file.
  (svn_repos_hooks_setenv): Expect a path to a hooks environment configuration
   file, instead of a single environment hash.
  (create_svn_repos_t): Initialise hooks_env to NULL (i.e. empty environment).

* subversion/libsvn_repos/repos.h
  (SVN_REPOS__CONF_HOOKS_ENV,
   SVN_REPOS__HOOKS_ENV_DEFAULT_SECTION): New named contants.
  (svn_repos_t): Update doc string for hooks_env member.

* subversion/mod_dav_svn/dav_svn.h
  (dav_svn__get_hooks_env): Update declaration.

* subversion/mod_dav_svn/mod_dav_svn.c
  (dir_conf_t): The hooks_env member is now a path to a configuration file,
   rather than a hash table.
  (SVNHooksEnv_cmd): Expect a path to a configuration file instead of a
   list of environment variables and their values.
  (dav_svn__get_hooks_env): Return a path (const char *) instead of a hash.
  (cmds): Update documentation of SVNHooksEnv option.

* subversion/mod_dav_svn/repos.c
  (get_resource): Update call to svn_repos_hooks_setenv().

* subversion/svnserve/serve.c
  (hooks_env_conf_cb): Remove, now unused.
  (find_repos): Get the hooks-env option from the configuration, which
   now specifies the path to the hooks-env file, rather than parsing
   'hooks-env' as a section of options.


Changed paths

Path Details
Directorysubversion/trunk/subversion/include/svn_config.h modified , text changed
Directorysubversion/trunk/subversion/include/svn_repos.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_ra_local/split_url.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_repos/hooks.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_repos/repos.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_repos/repos.h modified , text changed
Directorysubversion/trunk/subversion/mod_dav_svn/dav_svn.h modified , text changed
Directorysubversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c modified , text changed
Directorysubversion/trunk/subversion/mod_dav_svn/repos.c modified , text changed
Directorysubversion/trunk/subversion/svnserve/serve.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26