I have an issue that is driving me crazy. I want to integrate VisualSVN Server with Mantis BT, so when I commit from the svn client, and I comment something like "fixed issue #3" then the issue in Mantis is marked as resolved.
I followed the steps in http://arklad.wordpress.com/2010/01/07/communicating-mantis-and-subversion-on-windows/
So I create an user in Mantis named 'svn' with developer role, and assigned to my project. I've edited my mantis config.inc
and it looks like this:
<?php $g_hostname = 'databaseserver'; $g_db_type = 'mssqlnative'; $g_database_name = 'mantisbt'; $g_db_username = 'mantis'; $g_db_password = 'mypass'; $g_allow_file_upload = ON; $g_file_upload_method = DISK; # User account that connects with Subversion $g_source_control_account = 'svn'; # Regular expression to be matched in the comments # Example: issue #1 $g_source_control_regexp = '/\b(?:bug|issue|error)\s*[#]{0,1}(\d+)\b/i'; # Regular expression to be matched to fix an issue # Example: fixed issue #1 $g_source_control_fixed_regexp = '/\b(?:fixed|fixes|resolved)\s+(?:bug|issue|error)?\s*[#](\d+)\b/i'; # Status after solving the issue $g_source_control_set_status_to = RESOLVED; # Resolution after solving the issue $g_source_control_set_resolution_to = FIXED; ?>
Then I create the post-commit.bat
file and place it in the hooks folder:
@ECHO on SET REPOS=%1 SET REV=%2 SET PHP="C:\Program Files (x86)\PHP\v5.3\php.exe" SET CHECKIN="C:\WebSites\mantisbt-1.2.14\scripts\checkin.php" SET SVNLOOK="C:\Program Files (x86)\VisualSVN Server\bin\svnlook.exe" SET LOGFILE=C:\log.txt SET AUTHORFILE=C:\author.txt SET OUTPUTFILE=C:\output.txt %SVNLOOK% log -r %REV% %REPOS% > %LOGFILE% %SVNLOOK% author -r %REV% %REPOS% > %AUTHORFILE% TYPE %LOGFILE% > %OUTPUTFILE% %PHP% %CHECKIN% < %OUTPUTFILE% >> %LOGFILE% ECHO "Post-commit for revision %REV% finished" >> %LOGFILE% @ECHO off
All the paths are allright (checked many times) and the .bat
executes well when I run separately (It creates the output files).
I came to the conclusion that VisualSVN is not triggering the post-commit.bat
. I restarted many times the server also. What am I doing wrong?