Subversion and Mantis Integration on Windows

We're running Subversion (via Apache) and Mantis on Windows. I wanted to allow developers to resolve issues via commit comment. I read this great page about it, and used it as a starting point for Windows integration.

After making Mantis configuration changes as specified in that page, I threw together a SVN post-commit hook that I named post-commit.cmd. It looks like this:

@echo off
setlocal enableextensions

set SVN_PATH="c:\Program Files\svn-win32-1.6.1\bin"
set REPOS=%1
set REV=%2
set TEMPFILE=c:\temp\%REV%.txt

set MANTIS_PATH="c:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mantis"

cd %MANTIS_PATH%\scripts

%SVN_PATH%\svnlook log -r %REV% %REPOS% > %TEMPFILE%

php checkin.php < %TEMPFILE% > c:\post_commit.log

Obviously, update the paths to Subversion and Mantis.

Now, when somebody puts "issue #56" in a commit comment, a note gets added to the bug in Mantis. When a developer adds "fixes issue #56" in a commit comment, the issue also gets set to "resolved."