tags:

views:

1298

answers:

4

I'm using a subversion repository and I want to know whenever somebody asks my repository for a checkout; like a 'svn co' or an 'svn up'. Is there a hook or some other method that I can use so that a script is run, or email sent, whenever somebody requests information from my svn server? How can I achieve this without relying on apache logs?

BTW it is a pretty simple repository just meant for Educational purposes.

(If you need more information then just ask. Thanks in advance.)

A: 

Looking at a repository created with svnadmin, there is no pre or post update hook template. You could always create a pre-update hook (pre-update.bat for windows) and see if it works.

phsr
+5  A: 

The following are all the supported hooks in Subversion 1.5, from the Version Control with Subversion book:

  • start-commit
  • pre-commit
  • post-commit
  • pre-revprop-change
  • post-revprop-change
  • pre-lock
  • post-lock
  • pre-unlock
  • post-unlock

There is no pre-checkout or pre-update hook like you describe.

Greg Hewgill
+6  A: 

Here's a guy that claims to have done it in Ruby.

blog entry

Joshua Belden
A good answer so +1 and it's clever what he did, but I don't want to manipulate apache logs just for it to work. That makes the assumption that I am running my server through apache; which I am not.
Robert Massaioli
Your link appears to be broken, try this one instead: http://sikanrong.com/blog/subversion_checkout_hooks_in_ruby_
Evan
+1 apache logs are the only reasonable way to do this without control over the clients
Wim Coenen
This seems like the best way to do it so marking as answer. I'm going to go look at the svn source code and see If I can write my own hook event...
Robert Massaioli
+1  A: 

If you are using TortoiseSVN, you have access to client-side hooks.

Si
+1 good solution if you need to control and manage the client configurations anyway, e.g. for autoprops settings
Wim Coenen