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

Re: pre-commit hook - acces file content?

From: Ryan Schmidt <subversion-2006c_at_ryandesign.com>
Date: 2006-07-07 19:24:31 CEST

On Jul 7, 2006, at 16:20, Ute Platzer wrote:

> I'd like to write a pre-commit hook that checks the committed file
> for correct
> content/syntax. But I dont' know how to get the name or the content
> of the
> committed file - (the pre-commit hook script gets the repository
> path and
> transaction id as paramaters, but not a filename as in CVS). How
> can I do that?

Hi Ute. The basic strategy is:

- call "svnlook changed" on the transaction to see what files are
being changed in the transaction
- call "svnlook cat" on each file to get the contents and perform
your checks

Here's an example that does some checking on committed Java files;
might be a good starting point for your script:

http://svn.haxx.se/users/archive-2006-06/0853.shtml

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jul 7 19:26:11 2006

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.