View Issue Details

IDProjectCategoryView StatusLast Update
0009152mantisbtintegrationpublic2010-09-19 03:11
ReporterNetson Assigned Todhx  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionwon't fix 
Product Version1.1.1 
Summary0009152: Suggestion for different regular expression in checkin for SVN integration
Description

A minor thing, but after some testing and tweaking I came up with a slightly different regular expression that allows for a little more freedom when integrating Mantis with your favorite repository (SVN in my case).

It also doesn't require to use two seperate expressions anymore to determine if an issue was fixed or not.

"/^\s(?:(fix(?:ed|es)\s+){0,1})(?:issue|bug)\s+[#]{0,1}\s([0-9]{7}).*/";

Steps To Reproduce

Quick and dirrty message that will get accepted:

$log = " issue 0000007 log message goes here";
$match = array();

$expression = "/^\s(?:(fix(?:ed|es)\s+){0,1})(?:issue|bug)\s+[#]{0,1}\s([0-9]{7}).*/";

$log = trim($log);
if(preg_match_all($expression, $log, $match)) echo "issue # detected";
else echo "nope, keep trying...";

echo "\n\n";
print_r($match);

Additional Information

Quick explanation of what the regex does:

  • allows for white space at the beginning of the log message
  • if fixed or fixes appends the log message, the second element is populated
  • if fixed/fixes is not found, the second element is empty
  • allows for the use of both 'bug' and 'issue'
  • the third element is the issue number (always needs to be 7 digits)
  • allows for the optional use of the # sign, with or without spaces after

Of course the code in the checkin file will need to be changed, but as that isn't rocket science, I won't post any code for that.

TagsNo tags attached.

Relationships

related to 0011732 closeddhx Remove built-in source code integration support 

Activities

Netson

Netson

2008-05-14 23:36

reporter   ~0017837

One more thing, just started using Mantis and I absolutely love it! :) fully integrated with SVN :)

dhx

dhx

2010-03-31 03:22

reporter   ~0024938

Won't fix as this old source code integration support is being dropped in favour of using a more modern plugin approach with the SourceIntegration plugin.

Refer to 0011732 for more details and feedback.