Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have you integrated Mantis and Subversion?

Tags:

svn

mantis

scmbug

I do mostly Windows development. We use Mantis and Subversion for our development but they aren't integrated together, in fact they are on different servers.

I did a little googling about integrating the two together and came across this post. It looked interesting.

I was wondering if anyone is doing this or has done this and what your experience has been. If you've got a different solution, I'd be interested in knowing that too!

Thanks!

like image 483
itsmatt Avatar asked Sep 24 '08 00:09

itsmatt


2 Answers

I use Mantis with SVN. Pretty much as that link says, though I put the regexp in the post-commit so it doesn't try to update the bug if the commit message is not relevant, that makes non-bug-updating commits respond slightly faster.

My Mantis install is on a different server too. I use curl to call the php method in Mantis 1.1.6.

Put this in your post-commit.cmd hook (you'll need to download strawberry perl and grab perl.exe and perl510.dll from it, you don't need the rest)

c:\tools\perl c:\tools\mantis_urlencode.pl %1 %2  > c:\temp\postcommit_mantis.txt
if %ERRORLEVEL% NEQ 0 exit /b 0

c:\tools\curl -s -d user=svn -d @c:\temp\postcommit_mantis.txt http://swi-sgi-l-web1.ingrnet.com/mantis/core/checkincurl.php

and put this in mantis_urlencode.pl

$url = `svnlook log -r $ARGV[1] $ARGV[0]`;

# check the string contains the matching regexp, 
# quit if it doesn't so we don't waste time contacting the webserver
# this is the g_source_control_regexp value in mantis.

exit 1 if not $url =~ /\b(?:bug|issue|mantis)\s*[#]{0,1}(\d+)\b/i;

$url = $url . "\n" . `svnlook dirs-changed -r $ARGV[1] $ARGV[0]`;

#urlencode the string
$url =~ s/([^\w\-\.\@])/$1 eq " "?"+":  sprintf("%%%2.2x",ord($1))/eg;

print "log=$url";

exit 0;

If you want to migrate from VSS, there are a load of scripts, including one I wrote on codeplex.

It all works well, we use it all the time, and its quick enough not to notice its there. Just type "Fixed Mantis #1234" and it resolves the bug and adds a bugnote to it. The script also adds the directories that were modified to the bugnote too (I tried showing changed files but too many detract from easy understanding)

like image 95
gbjbaanb Avatar answered Sep 22 '22 15:09

gbjbaanb


We've used scmbug for quite some time to link SVN to Bugzilla. Worked very well until we upgraded to Bugzilla 3.2 recently, which broke the integration. It takes a little while for the scmbug team to catch up when new releases of the SCM tools come out, which is understandable.

like image 35
Larry Silverman Avatar answered Sep 22 '22 15:09

Larry Silverman