I’ve got a situation where I’m contemplating using subversion/svn as the repository/version control system for a project. I’m trying to figure out if it’s possible, (and if so, how) to be able to have the subversion system, on a post commit hook/process to to write the user/file/time (and maybe msg) to either an external file (csv) or to a mysql db.
Once I can figure out how to invoke the post commit hook to write the output to a file, I can then modify my issue tracker/project app to then implement a basic workflow process based on the user role, as well as the success/failure of the repository files.
Short sample/pointers would be helpful.
My test env, is running subversion/svnserve on centos5. The scripting languages in use are Php/Python.
I would say that’s possible, but you are going to need a bit of work to retrieve the username, date and commit message.
Subversion invokes the post-commit hook with the repo path and the number of revision which was just committed as arguments.
In order to retrieve the information you’re looking for, you will need to use an executable by the name of
svnlook, which is bundled with Subversion.See repo\hooks\post-commit.tmpl for a rather clear explanation about how to use it
Also, take a look at
svnlook help, it’s not difficult to use.