View Issue Details

IDProjectCategoryView StatusLast Update
0006368mantisbtfeaturepublic2008-08-12 09:35
ReporterDirk Datzert Assigned Tograngeway  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version0.19.3 
Summary0006368: Render Links in bugnote for t_cvs_web posted by scmbug
Description

Scmbug post changes of files from Subversion commit into bugnotes
like:

r1 --> r2 repository path/filename

This patch will make it possible to gather enough information in
Mantis to display a link back to ViewCVS.

r1 --> r2 repository path/filename
will be display'd in mantis like
[SCM] r1 --> r2 repository <a
src="ViewCVS-URL/repository/path/filename?r1=r1&r2=r2">path/filename</a>

Additional Information

Link to the Reference ticket of scmbug http://bugzilla.mkgnu.net/show_bug.cgi?id=266#c5

TagsNo tags attached.
Attached Files
mantis-string-api-scmbug.patch (1,363 bytes)   
--- mantis-0.19.2/core/string_api.php.orig	2005-05-07 14:19:57.000000000 +0200
+++ mantis-0.19.2/core/string_api.php	2005-05-07 17:46:51.895972489 +0200
@@ -96,6 +96,7 @@
 		$p_string = string_process_bug_link( $p_string );
 		$p_string = string_process_bugnote_link( $p_string );
 		$p_string = string_process_cvs_link( $p_string );
+		$p_string = string_process_scmbug_link( $p_string );
 
 		return $p_string;
 	}
@@ -164,6 +165,25 @@
 	}
 
 	# --------------------
+	# process the $p_string and convert filenames in the format
+	# number --> number [repos] path/filename.ext to a html link
+	# if $p_include_anchor is true, include an <a href="..."> tag,
+	#  otherwise, just insert the URL as text
+	function string_process_scmbug_link( $p_string, $p_include_anchor=true ) {
+		$t_cvs_web = config_get( 'cvs_web' );
+
+		if ( $p_include_anchor ) {
+			$t_replace_with = '[SCM] \\1 --&gt; \\2 \\3 <a href="'.$t_cvs_web.'/\\3/\\4?r1=\\1&r2=\\2" target="_new">\\4</a><br';
+		} else {
+			$t_replace_with = '[SCM] '.$t_cvs_web.'/\\3/\\4?r1=\\1&r2=\\2 \\1 --&gt; \\2 \\3 \\4<br';
+		}
+
+		return preg_replace( '/(\d+) --&gt; (\d+) ?(.+)? (.+)<br/i',
+					 $t_replace_with,
+					 $p_string );
+	}
+
+	# --------------------
 	# Process $p_string, looking for bug ID references and creating bug view
 	#  links for them.
 	#
mantis-string-api-scmbug.patch (1,363 bytes)   

Activities

Dirk Datzert

Dirk Datzert

2005-10-27 17:35

reporter   ~0011556

Bugzilla has addressed with the same issue: https://bugzilla.mozilla.org/show_bug.cgi?id=314097

grangeway

grangeway

2008-05-04 06:19

reporter   ~0017761

Thank you for taking the time to report a problem with mantis.

This issue hasn't been touched in ages, and in 1.2.0 we have been working on support for plugins.

The SVN trunk currently has a mantiscoreformatting plugin - it strikes me that the scmbug functionality (if still required) should be implemented by making an additional formatting plugin that parses for the scmbug links.

Seperately to this, I think jreese has been working on some scm plugin support for mantis - I haven't looked at what this does so am not aware of whether they would overlap or fit together etc. I believe he's plugin can be found at http://github.com/jreese/mantis-source-integration/tree/master

Again, thank you for your bug report and your continued support.
Paul