What kinds of hook scripts are people using for Subversion? Just general ideas but code would be great too!
We check the following with our hook scripts:
We still want to implement the following:
If you have a mix of unix and Windows users working with the repository, I urge you to use the case-insensitive.py pre-commit hook-script as a precautionary measure. It prevents hard-to-sort-out situations where svn updates fail for Windows users because of a file rename which only changed the case of the file name. Believe me, there is a good chance it will save you trouble.
For those who are looking for a pre-revprop-change.bat for a snvsync operation :
https://gist.github.com/1679659
@ECHO OFF
set user=%3
if /I '%user%'=='syncuser' goto ERROR_REV
exit 0
:ERROR_REV echo "Only the syncuser user may change revision properties" >&2
exit 1
It just comes from here : http://chestofbooks.com/computers/revision-control/subversion-svn/Repository-Replication-Reposadmin-Maint-Replication.html and has been adapted for Windows.
I forgot to enter a comment while committing. Didn't have time to figure out why my pre-revprop-change hook wasn't working. So the following svnadmin command worked for me to enter a commit message:
svnadmin setlog <filesystem path to my repository> --bypass-hooks -r 117 junk
,
where "junk" is the file containing the text which I wanted to be the comment. svn setlog help
has more usage info...