SVN post-commit with windows

General discussion of Mantis.

Moderators: Developer, Contributor

SVN post-commit with windows

Postby edomal » Feb 02, 2012 11:05 am

My system has the following components:

mysql 5.0.51a
PHP 5.3.5
Apache 2.2.21
mantis bt 1.2.28
SVN 1.6.17
websvn 2.3.3
plugins-source-integration 0.13.2-177

I'm in trouble with SVN post-commit hook. I''m working in windows (XP sp3), so the hook script has to ba a .bat file written in a windows good code.
in Source plug-in the post-commit.tmpl is written for linux... Who can help me?

Then if I trie to see http://localhost/mantis/plugin.php?page=Source/checkin I obtain "APPLICATION ERROR #200
A required parameter to this page (api_key) was not found"
edomal
 
Posts: 12
Joined: Jan 31, 2012 2:58 am

Re: SVN post-commit with windows

Postby edomal » Feb 09, 2012 4:34 am

Hi.

Thank to Alain D'EURVEILHER now everythong works. The post-commit .bat file must be like this:

@ECHO OFF
SETLOCAL
set REPOS="SVNrepo"
set REV=%2
set CHECKINURL="http://localhost/mantis/plugin.php?page=Source/checkin"
C:\server\curl.exe -d "repo_name=%REPOS%" -d "data=%REV%" -d "api_key=1" %CHECKINURL%

where api_key is the same set in the repository configuration!!!
Last edited by edomal on Feb 09, 2012 5:20 am, edited 1 time in total.
edomal
 
Posts: 12
Joined: Jan 31, 2012 2:58 am

Re: SVN post-commit with windows

Postby AlainD. » Feb 09, 2012 5:18 am

Perfect! :wink:

It was a bit difficult for me to set it up at the beginning too, but it's really worth it to spend some time to make it work!
Enjoy the rest...

I could give you some more tips maybe for WebSVN to make the mantis tiket in the log message clickable and linked to mantis ;-)
Ha... but I just realized that it's already handled in the last version 2.3.3 of WebSVN (I used the 2.3.2 which does not support it...). So I guess it's all fine then.
AlainD.
ti lamp, ti lamp n'arivé!
Mantis: 1.2.5
PHP: 5.2.0
OS: Linux (etch)
Plugins: MantisGanttChart | Mantis Graphs | Source Control Integration | Subversion / WebSVN Integration
AlainD.
 
Posts: 46
Joined: Mar 23, 2011 9:30 am
Location: Bruxelles

Re: SVN post-commit with windows

Postby jagtap.suhas » Oct 05, 2012 12:29 am

Have integrated Mantis 1.2.x and subversion properly using above bat file.
But i need help on updating multiple issues at the same commit.
When i provide multiple bugs separated by comma while committing in svn (Tortoise svn). It doesn't write anything in second bug number.
jagtap.suhas
 
Posts: 7
Joined: Mar 09, 2012 7:07 am

Re: SVN post-commit with windows

Postby AlainD. » Oct 05, 2012 1:41 am

I'm using the following regexp in the configuration of the Mantis plugin 'source control':

Bug Link Regex Pass 1:
Code: Select all
/(?:bugs?|issues?|reports?)+:?\s+(?:#(?:\d+)[,\.\s]*)+/i

Bug Link Regex Pass 2:
Code: Select all
/#?(\d+)/


And it works fine for me.
For each mantis issue number, the # is mandatory. Thus, for me:
"#1203, 1204, #1205" will attach the commit only in the tickets 1203 and 1205, not in 1204.
AlainD.
ti lamp, ti lamp n'arivé!
Mantis: 1.2.5
PHP: 5.2.0
OS: Linux (etch)
Plugins: MantisGanttChart | Mantis Graphs | Source Control Integration | Subversion / WebSVN Integration
AlainD.
 
Posts: 46
Joined: Mar 23, 2011 9:30 am
Location: Bruxelles

Re: SVN post-commit with windows

Postby jagtap.suhas » Oct 05, 2012 5:02 am

/(?:bugs?|issues?|reports?)+:?\s+(?:#(?:\d+)[,\.\s]*)+/i
This one is not working for me.... :(

Currently i am using Following regex, which is working for single bug id.

Bug Link Regex Pass 1:- /\b(?:bug|issue|task)\s*[#]{0,1}(\d+)\b/i
Bug Fixed Regex Pass 1:- /\bfix(?:ed|es)\s+(?:bug|issue|task)?\s*[#]{0,1}(\d+)\b/i

Any idea ?
jagtap.suhas
 
Posts: 7
Joined: Mar 09, 2012 7:07 am

Re: SVN post-commit with windows

Postby AlainD. » Oct 05, 2012 6:15 am

Before we analyze, can also paste here a log message you use with several mantis ID ?
thx.
AlainD.
ti lamp, ti lamp n'arivé!
Mantis: 1.2.5
PHP: 5.2.0
OS: Linux (etch)
Plugins: MantisGanttChart | Mantis Graphs | Source Control Integration | Subversion / WebSVN Integration
AlainD.
 
Posts: 46
Joined: Mar 23, 2011 9:30 am
Location: Bruxelles

Re: SVN post-commit with windows

Postby AlainD. » Oct 05, 2012 6:31 am

jagtap.suhas wrote:/(?:bugs?|issues?|reports?)+:?\s+(?:#(?:\d+)[,\.\s]*)+/i
This one is not working for me.... :(

Currently i am using Following regex, which is working for single bug id.

Bug Link Regex Pass 1:- /\b(?:bug|issue|task)\s*[#]{0,1}(\d+)\b/i
Bug Fixed Regex Pass 1:- /\bfix(?:ed|es)\s+(?:bug|issue|task)?\s*[#]{0,1}(\d+)\b/i

Any idea ?

anyway... I can see why, because your pattern only take into account one occurence of an issue id: [#]{0,1}(\d+)
(which means by the way "one series of digits preceeded by one or no #")
Besides, "[#]{0,1}" is better written as: "#?". That's the meaning of the "?" when placed after the letter. So let's use this one instead.

if you want this occurence to be repeated you need to:
- encapsulate the expression in a new pair of parenthesis, for instance: (#?(\d+))
- and specify how many occurences: "+" at least one ? or "*" zero or at least one. Then at the end if we want at least one: (#?(\d+))+

But here we don't take into account yet the separator between the different mantis ID. If you want to use a space, or a comma, you must add also the separator inside. For instance [\s,] for allowing comma or space as separator. Of course it could happen that there is only one mantis issue concerned, so we must use the star * to say that there is zero or more of one character among [\s,]:
(#?(\d+)[,\.\s]*)+

Finally the full expression would be:
Bug Link Regex Pass 1:-
Code: Select all
/\b(?:bug|issue|task)\s*(#?(\d+)[,\.\s]*)+\b/i

Bug Fixed Regex Pass 1:-
Code: Select all
/\bfix(?:ed|es)\s+(?:bug|issue|task)?\s*(#?(\d+)[,\.\s]*)+\b/i


Try this, and tell us back if it's OK.
AlainD.
ti lamp, ti lamp n'arivé!
Mantis: 1.2.5
PHP: 5.2.0
OS: Linux (etch)
Plugins: MantisGanttChart | Mantis Graphs | Source Control Integration | Subversion / WebSVN Integration
AlainD.
 
Posts: 46
Joined: Mar 23, 2011 9:30 am
Location: Bruxelles

Re: SVN post-commit with windows

Postby jagtap.suhas » Oct 05, 2012 7:48 am

Alain,

It worked like charm.. I can able to resolve multiple bugs in same commit , using regex string given by you.
It is very difficult for me to resolve this.

Thank you very much for your time and consideration :D
jagtap.suhas
 
Posts: 7
Joined: Mar 09, 2012 7:07 am

Re: SVN post-commit with windows

Postby peter9091 » Oct 22, 2012 1:23 am

Hi everyone .... Before we analyze, can also paste here a log message you use with several mantis ID ?
Do you want to pass ccna http://www.testking.org/ exam? Check out our latest exam testking 640-802 which gives you 100% exam pass guarantee.
peter9091
 
Posts: 1
Joined: Oct 22, 2012 1:20 am

Re: SVN post-commit with windows

Postby AlainD. » Oct 22, 2012 3:55 pm

Hi, is there a question somewhere ? Why do you quote me ?
AlainD.
ti lamp, ti lamp n'arivé!
Mantis: 1.2.5
PHP: 5.2.0
OS: Linux (etch)
Plugins: MantisGanttChart | Mantis Graphs | Source Control Integration | Subversion / WebSVN Integration
AlainD.
 
Posts: 46
Joined: Mar 23, 2011 9:30 am
Location: Bruxelles

Re: SVN post-commit with windows

Postby atrol » Oct 23, 2012 1:59 am

AlainD. wrote:Why do you quote me ?
Maybe he is just trying to enter enough posts to get the right to post without going through moderation. After that, we will get some spam ;-)
Sorry peter (or DaviD?), if I am wrong.
Please use Search before posting and read the Manual
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
 
Posts: 3633
Joined: Mar 26, 2008 4:37 pm
Location: Germany


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron