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

Re: SVN hook help

From: David Weintraub <qazwart_at_gmail.com>
Date: Wed, 27 Aug 2008 12:49:21 -0400

Is there a scripting language such as Perl or Python that you are
comfortable programming in? I would recommend installing one of those
on your system. Or, Ruby... Whatever you're comfortable in
programming. Heck, you can program everything in C or C++. The
language isn't that important, but the standard Windows batch program
language is probably not powerful enough to use for the purposes of
hooks.

Writing a trigger is fairly straight forward. There is already a
"pre-commit" hook script called pre-commit.tmpl that comes with the
Subversion source distribution (and maybe some of the executable
versions too). It contains a lot of information about writing your own
hook script and how you'd call it. Normally, you'll use the "svnlook"
command, and parse its output to look for whatever you want.

There is also a Python hook (and I have a Perl version) that allows
you to define who can check in what types of files. You can use this
hook to specify that you don't want weblogic.jar (or other file types)
checked into your repository.

--
David Weintraub
qazwart_at_gmail.com
On Wed, Aug 27, 2008 at 6:32 AM, venkata prasad
<prasadeceonline_at_gmail.com> wrote:
> Thanks and also sorry for my late reply; I was on vacation;
>
> I am working on windows. Can i still run WC command...
> Please help me with the batch or execultable script.
>
> Thanks,
> Prasad.
>
>
> On 8/14/08, Ryan Schmidt <ryandesign_at_macports.org> wrote:
>>
>> On Aug 14, 2008, at 02:38, venkata prasad wrote:
>>
>>> I want to  place an SVN- hook for not allowing to add an element of size
>>> more than 200MB.
>>
>> Ok. In the pre-commit hook, you would use "svnlook changed" to get a list
>> of changed files. You can then "svn cat" each file and pipe it through "wc"
>> to get a byte count. Note that the file will still be transferred over the
>> network to the server in its entirety, even though the file will not be
>> accepted into the repository due to your restriction.
>>
>>> Also dont want to allow adding weblogic.jar file for my repository.
>>
>> Same deal: run "svnlook changed" to get the list of changed files, and if
>> weblogic.jar is listed, deny the commit.
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-08-27 18:49:43 CEST

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.