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

Re: svn commit: r1375675 - in /subversion/trunk/subversion: include/svn_repos.h libsvn_repos/fs-wrap.c libsvn_repos/hooks.c libsvn_repos/repos.c libsvn_repos/repos.h tests/cmdline/commit_tests.py tests/cmdline/svntest/actions.py

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Tue, 21 Aug 2012 14:15:44 -0400

On 08/21/2012 02:02 PM, Bert Huijben wrote:
> When is this script run when committing with a non http-v2 dav client?
>
> Are the txnprops available then? Or just with the other ra layers and
> new dav clients?

The script is still run after the txn is created and the initial txnprops
set. So, you'll get svn:date and svn:author, but not svn:log or the
user-provided custom revprops. (If this is a point of concern, the hook
author can simply bounce commits on the grounds that the client isn't new
enough for its standards.)

>> +svn_error_t *
>> +svn_repos__hooks_init_commit(svn_repos_t *repos,
>> + const char *txn_name,
>> + apr_pool_t *pool)

[...]

> Should we also pass the user here?
>
> We pass it for at least some of the other hooks and I'm not sure if it is
> guaranteed always to be the same as the one stored in the transaction
> properties.

It would have *just* been set as the svn:author txnprop, but I strictly
speaking there is a race condition between the time the property is set and
the time the hook executes. If a program was able to guess the name of the
newly created transaction and change svn:author before the hook examined it,
that might be a point of concern?

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development

Received on 2012-08-21 20:16:18 CEST

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