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

Re: Adding/defining a property during commit

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-06-14 00:06:00 CEST

On Jun 12, 2007, at 08:26, marc ballat wrote:

> I know that a hook script should not modify the content of a commit
> transaction.
> Does anyone have a solution to add a property during commit when
> the client can either be Tortoise, the command line or Apache and
> mod_dav_svn ?

What kind of property? If you mean a versioned property on a file,
then your hook script would have to check out a new working copy (or
update an existing server-side one), "svn propset" the property on
the file, and "svn commit" the new revision. You would have to
engineer the hook carefully so that it would not act on the commit
that it itself is then performing.

If you mean an unversioned revision property, then you can set the
property easily. Just "svn propset --revprop -r $REV file://$REPOS
$PROP_NAME $PROP_VALUE". You would need to install a pre-revprop-
change hook which allows revprop changes to take place. Also note
that I'm using the argument "-r $REV" to specify the revision. "svn
help propset" shows that there is no way to tell it to use a
transaction instead of a revision. So this would only work in, for
example, the post-commit hook, not the pre-commit hook.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jun 14 00:07:12 2007

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.