You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ute Platzer <up...@schlund.de> on 2006/07/07 14:20:16 UTC

pre-commit hook - acces file content?

Hi,

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?

Thanks for your help,
ute

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

Re: pre-commit hook - acces file content?

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