Using Subversion Hooks to send out build emails
The subversion version control system has a wonderfully handy feature called hooks. Hooks are essentially scripts that are triggered by a version control event (such as a commits, or revision property changes).
Subversion Hooks are located in your repository directory (so if you have multiple repositories you have to setup hooks for each one) in a directory called
hooks, perhaps something like this:
/home/svn/projectName/hooks. There are template files (.tmpl) in the directory for each event (these files are just examples). The events are:
- start-commit - run before commit transaction begins, can be used to do special permission checking
- pre-commit - run at the end of the transaction, but before commit. Often used to validate things such as a non zero length log message.
- post-commit - runs after the transaction has been committed. Can be used for sending emails, or backing up repository.
- pre-revprop-change - runs before a revision property change. Can be used to check permissions.
- post-revprop-change - runs after a revision property change. Can be used to email or backup these changes.
In your hooks directory you will find a .tmpl file with each of the event names, if you want to enable one of the hooks, copy the template file (without the .tmpl extension) and make it executable.
Note: On windows you need to rename the .tmpl file with an extension that is executable by windows such as an exe or bat file.
If you want to send out a build email on
post-commit copy the
post-commit.tmpl file to
post-commit and make it executable. Edit the file, and add your email addresses.
Subversion comes with a few other pre-built hook scripts, there is a
hot-backup.py script that can be used to make hot backups of your repository after commits.
You might also like:
- Bug Report hooks for FindBugs and Subversion - May 9, 2005
- Subversion commit message validator pre-commit hook - May 31, 2005
- Top 10 Things I like about subversion - February 22, 2005
- Subversion Better than CVS? - March 4, 2004
I mean everytime there is an earthquake, a flood, an oil spill - there's always a group of heartless people who rip off tax payers.
This is in response to reading that 4 of Oprah Winfreys "angels" got busted ripping off the system. Shame on them!
and some info , there very helpfull ,just say micky heemson recommened you