Page 1 of 1

Integrating Mantis and Subversion

Posted: 12 Mar 2009, 09:40
by matsos
Hello

I'm trying to integrate Mantis (v 1.1.6) and SVN, but although I followed the "http://alt-tag.com/blog/archives/2006/1 ... ubversion/" site, I didn't succeed in making the link.

This is my config.inc script :
***********
config_inc.php
***********
<?php
$g_hostname = 'localhost';
$g_db_type = 'mysql';
$g_database_name = 'mantis';
$g_db_username = 'root';
$g_db_password = 'smp';

// Liaison Mantis-SVN
$g_source_control_account = 'svn';
$g_source_control_regexp = '/\bissue [#]{0,1}(\d+)\b/i';

$g_source_control_set_status_to = CLOSED;
$g_source_control_set_resolution_to = FIXED;
$g_source_control_fixed_regexp ='/\bfix(?:ed|es)\s+(?:bug|issue)?\s*[#]{0,1}(\d+)\b/i';
?>
********
And what I get in the cmd windows when I try the first test :
C:\Serveur\PHP\php-5.2.9-Win32>%> C:\Serveur\PHP\php-5.2.9-Win32 C:\Serveur\CollabNet Subversion Server\httpd\htdocs\mantis\core\checkin.php 'issue #1'

Accès refusé.

Could anybody help me please ?
Thanks

Re: Integrating Mantis and Subversion

Posted: 13 Mar 2009, 12:47
by matsos
Hello,

After installing PHP again...
Here is the command I entered :
U:\>C:\Serveur\PHP\php.exe "C:\Serveur\CollabNet Subversion Server\httpd\htdocs\mantis\core\checkin.php" 'issue #1'

And here is the result
=> No answer
Then I make 'CTRL C' and I obtain :
Comment does not reference any issues.

Could you help me please ?
Thanks

Re: Integrating Mantis and Subversion

Posted: 29 Jul 2009, 21:10
by Crayon
Hi, I was having the same problem testing the file checkin.php. But when I decided to go one step ahead, it worked with the hook in subversion.

I'm using the file post-commit.bat:

Code: Select all

@ECHO off

SET REPOS=%1
SET REV=%2

SET PHP="C:\Program Files\PHP\php.exe"
SET CHECKIN=C:\….\mantis\scripts\checkin.php
SET SVNLOOK="C:\Program Files\Subversion\bin\svnlook.exe"

SET LOGFILE=log%REV%.txt
SET AUTHORFILE=author%REV%.txt
SET OUTPUTFILE=output%REV%.txt

%SVNLOOK% log -r %REV% %REPOS% > %LOGFILE%
%SVNLOOK% author -r %REV% %REPOS% > %AUTHORFILE%

ECHO SVN %REPOS% Revision %REV% > %OUTPUTFILE%
TYPE %AUTHORFILE% >> %OUTPUTFILE%
TYPE %LOGFILE% >> %OUTPUTFILE%

TYPE %OUTPUTFILE% | %PHP% %CHECKIN%

CALL DEL %LOGFILE%
CALL DEL %AUTHORFILE%
CALL DEL %OUTPUTFILE%
Don't forget to change the path for PHP, CHECKIN and SVNLOOK.

By the way thanks for linking this site: http://alt-tag.com/blog/archives/2006/1 ... ubversion/
It was really useful.

Merci :wink: