You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by ma...@excite.com on 2007/06/12 13:26:14 UTC

Adding/defining a property during commit



Hi there,



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 ?



Thanks in advance, Marc





_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


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

Re: Adding/defining a property during commit

Posted by Andy Levy <an...@gmail.com>.
On 6/12/07, marc.ballat@excite.com <ma...@excite.com> 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 ?
>

Or you could have your pre-commit hook look for the property on the
file(s) being checked in, and if it's missing, reject the commit and
return an informative message back to the user.

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

Re: Adding/defining a property during commit

Posted by Gerco Ballintijn <ge...@ballintijn.com>.
Ryan Schmidt wrote:
> 
> 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.
> 

Note that 1.5, whenever it will be finished, will also allow you to set
revision properties during a commit.

Gerco.

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

Re: Adding/defining a property during commit

Posted by Ryan Schmidt <su...@ryandesign.com>.
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