SVN post-commit with windows
Moderators: Developer, Contributor
SVN post-commit with windows
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"
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"
Re: SVN post-commit with windows
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!!!
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 09 Feb 2012, 10:20, edited 1 time in total.
Re: SVN post-commit with windows
Perfect!
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.
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
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
-
- Posts: 7
- Joined: 09 Mar 2012, 12:07
Re: SVN post-commit with windows
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.
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.
Re: SVN post-commit with windows
I'm using the following regexp in the configuration of the Mantis plugin 'source control':
Bug Link Regex Pass 1:
Bug Link Regex Pass 2:
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.
Bug Link Regex Pass 1:
Code: Select all
/(?:bugs?|issues?|reports?)+:?\s+(?:#(?:\d+)[,\.\s]*)+/i
Code: Select all
/#?(\d+)/
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
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
-
- Posts: 7
- Joined: 09 Mar 2012, 12:07
Re: SVN post-commit with windows
/(?: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 ?
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 ?
Re: SVN post-commit with windows
Before we analyze, can also paste here a log message you use with several mantis ID ?
thx.
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
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
Re: SVN post-commit with windows
anyway... I can see why, because your pattern only take into account one occurence of an issue id: [#]{0,1}(\d+)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 ?
(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
Code: Select all
/\bfix(?:ed|es)\s+(?:bug|issue|task)?\s*(#?(\d+)[,\.\s]*)+\b/i
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
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
-
- Posts: 7
- Joined: 09 Mar 2012, 12:07
Re: SVN post-commit with windows
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
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
Re: SVN post-commit with windows
Hi everyone .... Before we analyze, can also paste here a log message you use with several mantis ID ?
Re: SVN post-commit with windows
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
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
Re: SVN post-commit with windows
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 spamAlainD. wrote:Why do you quote me ?
Sorry peter (or DaviD?), if I am wrong.
Re: SVN post-commit with windows
Hi.
I use the following post-commit.bat:
@ECHO OFF
SETLOCAL
set REPOS="MyRep"
set REV=%2
set CHECKINURL="http://myserver:8080/mantis/plugin.php? ... ce/checkin"
'C:\Program Files (x86)\VisualSVN Server\curl.exe' -d "repo_name=%REPOS%" -d "data=%REV%" -d "api_key=37" %CHECKINURL%
But I have the following message:
post-commit hook failed (exit code 1) with output:
direcory, name, or volume label syntax is incorrect
what is wrong?
Please help me!!!
I use the following post-commit.bat:
@ECHO OFF
SETLOCAL
set REPOS="MyRep"
set REV=%2
set CHECKINURL="http://myserver:8080/mantis/plugin.php? ... ce/checkin"
'C:\Program Files (x86)\VisualSVN Server\curl.exe' -d "repo_name=%REPOS%" -d "data=%REV%" -d "api_key=37" %CHECKINURL%
But I have the following message:
post-commit hook failed (exit code 1) with output:
direcory, name, or volume label syntax is incorrect
what is wrong?
Please help me!!!
Re: SVN post-commit with windows
try using " instead of ' maybe ??
"C:\Program Files (x86)\VisualSVN Server\curl.exe" -d "repo_name=%REPOS%" -d "data=%REV%" -d "api_key=37" %CHECKINURL%
Also check that the path "C:\Program Files (x86)\VisualSVN Server\curl.exe" really exists.
"C:\Program Files (x86)\VisualSVN Server\curl.exe" -d "repo_name=%REPOS%" -d "data=%REV%" -d "api_key=37" %CHECKINURL%
Also check that the path "C:\Program Files (x86)\VisualSVN Server\curl.exe" really exists.
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
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
Re: SVN post-commit with windows
With " instead of ' I havo no errors but it doesn't work. If I look at the mantibt bug I have no changes (fixed i.e) neither in mantis repositories revisions are updated.
I have visualsvn 2.5.1, websvn 2.3.3, mantisbt 1.2.15 .
Visual SVN server uses port 8080.
SVN Repositories folder is C:\Repositories, while SVN folder is C:\Program Files (x86)\VisualSVN Server
I have visualsvn 2.5.1, websvn 2.3.3, mantisbt 1.2.15 .
Visual SVN server uses port 8080.
SVN Repositories folder is C:\Repositories, while SVN folder is C:\Program Files (x86)\VisualSVN Server