View Issue Details

IDProjectCategoryView StatusLast Update
0009054mantisbtintegrationpublic2010-09-19 03:11
Reportertettamanti Assigned Todhx  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionwon't fix 
Product Version1.1.1 
Summary0009054: Assign the note to the commiter
Description

Currently VCS integration works by using a predefined user to interact with the bug tracker. Unfortunately this tends to screw up the stats, since the "fake" account is doing all the work.

My patch allows to override the user on a per-commit basis:

  • if checkin.php is called with an additional parameter AND
  • the parameter is a valid user name
    it's used instead of $t_username (the default account)
    In case checkin.php is called without arguments or the name is not valid then the script falls back to the old behaviour.

Of course for this patch to work properly the username used on the VCS must match the one used in mantis.

Tagspatch, project_management
Attached Files
checkin.diff (570 bytes)   
Index: scripts/checkin.php
===================================================================
--- scripts/checkin.php	(revision 5162)
+++ scripts/checkin.php	(working copy)
@@ -41,6 +41,14 @@
 		exit( 1 );
 	}
 
+	# Override the username with the one passed on the command line - if any
+	if ($GLOBALS['argc'] > 1) {
+		$t_committer = $GLOBALS['argv'][1];
+
+		if (!is_blank( $t_committer ) && ( user_get_id_by_name( $t_committer ) != false ) )
+			$t_username = $t_committer;
+	}
+
 	if ( !defined( "STDIN" ) ) {
 		define("STDIN", fopen('php://stdin','r'));
 	}
checkin.diff (570 bytes)   

Relationships

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

Activities

dhx

dhx

2010-03-31 03:29

reporter   ~0024946

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.