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

Re: Is it possible to set svn:keywords using pre-commit hook script?

From: Andy Levy <andy.levy_at_gmail.com>
Date: Tue, 11 Nov 2008 14:13:31 -0500

On Tue, Nov 11, 2008 at 14:07, vinay i <vinay.indresh_at_gmail.com> wrote:
> But isn't there a way I can set the svn:keywords by running a script
> whenever I do a add or probably before a commit. Controlling this from a
> client side is painful.

Yes, you can set them client-side, via auto-props. Modifying an
in-flight transaction is even more painful than a hook script which
rejects the commit if your rules aren't followed.

> Hence, I would like to write script which will run
> svn propset svn:keywords <filenames>. But I am not sure whether it is
> feasible.

There is an svn_apply_autoprops Python script. It reads your client's
auto-props section of the config file, and applies any properties per
the rules set there. However, if you have set non-conforming
properties on files that match the auto-props, they will also be
removed.

> Please let me know your thoughts
>
> Thanks
> Vinay
>
> On Tue, Nov 11, 2008 at 11:45 PM, Andy Levy <andy.levy_at_gmail.com> wrote:
>>
>> On Tue, Nov 11, 2008 at 13:02, vinay i <vinay.indresh_at_gmail.com> wrote:
>> > Hello All,
>> >
>> > I would like to set svn:keywords on all known non-binary files (if it is
>> > not
>> > already set) during a commit. Is this feasible? Because pre-commit hook
>> > script takes two arguments as inputs ( repository and transaction) and
>> > doesn't have information regarding the files being committed. How to
>> > identify the list of files on which the svn:keywords property has to be
>> > set?
>>
>> Modifying transactions in-flight should not be done, for many reasons
>> which have been discussed many times on this mailing list. If a commit
>> doesn't conform to your rules, reject the commit & send a message back
>> to the client indicating why it was rejected.
>>
>> You need to use svnlook changed and svnlook diff to inspect what changed.
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-11-11 20:14:01 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.