View Issue Details

IDProjectCategoryView StatusLast Update
0006011mantisbtotherpublic2010-09-19 03:11
Reporterpneff Assigned Todhx  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionwon't fix 
Product Version1.0.0rc1 
Summary0006011: CVS Integration - added links to ViewCVS
Description

I have implemented a small patch to checkin.php. The existing configuration variable g_cvs_web is now used to link to ViewCVS.

This patch should be backward compatible, because the new routine only kicks in if g_cvs_web is defined and command line parameters are used. But in order to be used, the following must be done in the CVSROOT directory.

1)
Add the following line to config
UseNewInfoFmtStrings=yes

2)
Add the following line in loginfo
ALL /usr/bin/php /var/www/mantis/core/checkin.php %p %{sVv}

If checkin.php is already available in loginfo, just add the command line params.

You will find the patch attached.

TagsNo tags attached.
Attached Files
mantis-checkin-2005-07-25.patch (1,274 bytes)   
--- checkin.php.old	Mon Jul 25 21:09:21 2005
+++ checkin.php	Mon Jul 25 21:08:09 2005
@@ -32,6 +32,26 @@
 		define("STDIN", fopen('php://stdin','r'));
 	}
 
+	# If command line arguments are given, the format is as follows:
+	#   checkin.php directory {file rev_old rev_new}
+	$cvslinks = '';
+	if (count($argv) > 0 && !empty($g_cvs_web)) {
+		array_shift($argv);
+		$cvs_dir = array_shift($argv);
+
+		while (count($argv) >= 3) {
+			$cvs_file = array_shift($argv);
+			$cvs_version_prev = array_shift($argv);
+			$cvs_version_new = array_shift($argv);
+			if ($cvs_version_prev == 'NONE') {
+				// new file
+				$cvslinks .= $g_cvs_web.$cvs_dir."/".$cvs_file."?rev=".$cvs_version_new."&content-type=text/vnd.viewcvs-markup\n";
+			} else {
+				$cvslinks .= $g_cvs_web.$cvs_dir."/".$cvs_file.".diff?r1=".$cvs_version_prev."&r2=".$cvs_version_new."\n";
+			}
+		}
+	}
+
 	# Detect references to issues + concat all lines to have the comment log.
 	$t_commit_regexp = config_get( 'source_control_regexp' );
     $t_commit_fixed_regexp = config_get( 'source_control_fixed_regexp' );
@@ -52,6 +72,10 @@
 				$t_fixed_issues[] = $t_matches[1][$i];
 			}
 		}
+	}
+
+	if (!empty($cvslinks)) {
+		$t_comment .= "\n\n$cvslinks";
 	}
 
 	# If no issues found, then no work to do.

Relationships

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

Activities

polzin

polzin

2005-10-04 12:24

reporter   ~0011464

0005796 seems to be a more advanced solution...

dhx

dhx

2010-03-31 04:26

reporter   ~0024962

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.