Definitive help for integrating SVN with MantisBT ON WINDOWS

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mobius1qwe
Posts: 1
Joined: Feb 19, 2020 9:06 am

Definitive help for integrating SVN with MantisBT ON WINDOWS

Post by mobius1qwe »

Hello
I have read
https://web.archive.org/web/20120617102 ... subversion
https://guruce.com/blogpost/visualsvn-s ... ntegration
https://github.com/mantisbt-plugins/source-integration
I searched the web extensively but they seem to get me to Linux integration, I want the Windows version which isn't working for me and its frustrating.
I have MantisBT installed on my computer, it runs through Wampserver on MariaDB port 3306 if for some reason I change this port to be 3305 or 3307 so it doesn't conflict with MySQL db, it simply doesn't work, but moving on... to access Mantis I go to browser, type in localhost:8001/mantis and it works, mantis is installed, I can create projects, issues, assign users, all the good stuff. I also installed VisualSVN to try the integration and I control my SVN since 2014 with TortoiseSVN
http://prntscr.com/r4n8iu
Next step I downloaded the plugin package and installed all the plugins that had SVN on the name:
http://prntscr.com/r4n9mr
http://prntscr.com/r4n94x
(yes its in portuguese, I'm from Brazil)
Next step I opened the config for that plugin "Source Control Integration" and input the key and the folder to the SVN installation directory.
http://prntscr.com/r4nart
http://prntscr.com/r4naj7
Next I went to Repositories and created a new VisualSVN repository, filled the blanks with my configs
http://prntscr.com/r4n6qs
Next I tried to import data to that repository, it throws me an error:
"APPLICATION ERROR #plugin_SourceVisualSVNServer_svn_cmd

Subversion execution returned an error: ""."
Next I ignored these as I wasn't finding the solution anywhere in the web, I tried to adapt the Linux codes to my Windows setup, I searched the mantis folder to find out where that checkin.php archive was. I found it under "D:\Wamp64\www\mantis\plugins\Source\pages\checkin.php". So far so good, lets try to run that php cmd and see if it works... Where's the php cmd?
After searching for some minutes, I found one php.exe that should run php commands, inside "D:\Wamp64\bin\php\php7.3.12" folder.
I input the code

Code: Select all

php D:\Wamp64\www\mantis\plugins\Source\pages\checkin.php <<< "test Issue #61 Comment"
Nothing happened.
Tried removing 1 "<", nothing happened. Then out of curiosity I went to check out the checkin.php file, tring to see what that would do. The file is empty, full blank. Of Course it won't do anything. Tried downloading it again, wiped out the source folder, replaced it with the new one, retried the codde, nothing happened.
Then I thought, "ok, its not wanting to help me, I'll try something else" I went to Tortoise repo properties settings, because I read on TortoiseSVN forums that it has bugtracker compatibility, I would just need to add a few lines to it:
http://prntscr.com/r4nhey
The plus side is that my commit window looks prettier now, and it autofills whenever I start typing "fix":
http://prntscr.com/r4ni58
But I tried doing some commits to see if it would integrate with mantis, nothing happened.
Next step, I tried doing the post-commit hooks that TortoiseSVN has:
http://prntscr.com/r4njaj
But before it could work, I had to put the code on the folder, so I replaced the code:

Code: Select all

REPOS="$1"
REV="$2"
TXN_NAME="$3"

mailer.py commit "$REPOS" "$REV" /path/to/mailer.conf
With:

Code: Select all

REV="$2"
URL="http://localhost:8001/mantisbt/plugin.php?page=Source/checkin"
PROJECT="\\10.1.254.25\svn\repo"
API_KEY="svnkey"
LOG_FILE=`mktemp /tmp/svn_${PROJECT}_${REV}_log.XXX`
CURL=/usr/bin/curl
${CURL} -d "repo_name=${PROJECT}" -d "data=${REV}" -d "api_key=${API_KEY}" ${URL} >> ${LOG_FILE}
Time to test the commit:
http://prntscr.com/r4nn8v
Then the next step I did was writing all this post, redoing all the steps I did, asking for help, anyone that can help I'd love you forever.
I'm only asking because it works on Linux, it must work on windows too, I'm just not being able to make it work.

EDIT: The img tag seems to be broken, its not showing images, so I removed the tag and left only the image link

bluescreenterror
Posts: 8
Joined: Jan 16, 2020 6:19 am

Re: Definitive help for integrating SVN with MantisBT ON WINDOWS

Post by bluescreenterror »

Hi mobius1qwe,

I got Mants and VisualSVN working together on my Windows-Machine. I think you have made some mistakes in your config. But step by step...

1)set: $g_show_detailed_errors = ON; in your Mantisconfig, this will give you some extra information about ocurring errors
2) In the source configuration leave the path to the svn binary blank
3) Check if your VisualSVN-Server is reachable with your browser (check if Status HTTP service is running), got to the address which is shown when you click on your repository (In the Visual SVN Console)
4)On the VisulaSVN webpage click on checkout and copy the address which is shown
5)In Mantis got to Repository and create a new Repository with type VisualSVN Server
6)In the Url field paste the address which you have copied before on the VisualSVN webpage
7)Enter your credentials
8)Enable standard repository and click update repository
9)Go back and click import

For now deactivate the hook by simply renaming it. After the manual import is functioning we will fix your hook.
Mantis: 2.23.0
XAMPP: v.3.2.4
PHP Version: 7.1.33
Windows Server 2016

Post Reply