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

Re: svnserve not reading hooks-env?

From: Stefan Sperling <stsp_at_elego.de>
Date: Thu, 10 Nov 2016 17:40:10 +0100

On Thu, Nov 10, 2016 at 02:56:26PM +0000, Steven Simpson wrote:
> I'm starting to think that hooks-env with svnserve is a documented
> unfeature. ;-) I don't see it in the 1.7 docs, but it is in 1.8:
>
> <http://svnbook.red-bean.com/en/1.8/svn.serverconfig.svnserve.html#svn.serverconfig.svnserve.ref.general>
>
> I think I will have to do it the old-fashioned way.
>
> Cheers!
>

This looks like a bug where svnserve forgets about applying
a hook environment config after opening the repository.
So hooks always run in an empty environment with svnserve.

Ooops. I'm amazed it took so long for someone to notice :-)

This should fix it:

Index: subversion/svnserve/serve.c
===================================================================
--- subversion/svnserve/serve.c (revision 1768932)
+++ subversion/svnserve/serve.c (working copy)
@@ -3867,6 +3867,7 @@ find_repos(const char *url,
   if (hooks_env)
     hooks_env = svn_dirent_internal_style(hooks_env, scratch_pool);
 
+ SVN_ERR(svn_repos_hooks_setenv(repository->repos, hooks_env, scratch_pool));
   repository->hooks_env = apr_pstrdup(result_pool, hooks_env);
 
   return SVN_NO_ERROR;
Received on 2016-11-10 17:40:47 CET

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

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