Re: Post svn hook
From: Ryan Schmidt <subversion-2014_at_ryandesign.com>
Date: Fri, 16 May 2014 19:12:18 -0500
On May 15, 2014, at 17:51, Havlovick, Ron wrote:
> I am a newbie and I am more than a bit confused.
Look in the repository directory on the server. You should see among other things a "hooks" directory, containing sample scripts for each of the events for which Subversion can call hook scripts. These sample scripts have names ending in ".tmpl". They're written in Bash, which is for UNIX systems and won't usually work on Windows; for Windows, you'd need to write a batch script or a compiled executable. You'd place this script in the hooks directory, named the same as the relevant sample script, except without the ".tmpl" extension and with an extension appropriate for the type of file (e.g. "post-commit.bat" for a batch script, "post-commit.exe" for a compiled executable). Some other extensions are recognized by Subversion server on Windows as well, although I don't believe .pl is one of them, so you should probably write a small batch script or exe that runs your perl script.
The comments in the sample scripts tell you what arguments Subversion server supplies to the hook script when it runs it. For example, the post-commit script is given the repository path on disk as the first argument and the just-committed revision number as the second argument. So in Bash on UNIX, the repository path would be available as "$1" and the revision as "$2"; I don't know how that works in Windows batch files but there's probably a similar way to do that. So in Bash on UNIX, I could use that information to get the date of the commit by running "svnlook date $1 -r $2".
|
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.