[evolvis-commits] r13615: More verbosity on error when gathering CVS stats

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Feb 28 02:47:21 CET 2011


Author: mirabilos
Date: 2011-02-28 02:47:21 +0100 (Mon, 28 Feb 2011)
New Revision: 13615

Modified:
   trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/common/CVSPlugin.class.php
Log:
More verbosity on error when gathering CVS stats

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/common/CVSPlugin.class.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/common/CVSPlugin.class.php	2011-02-28 01:47:18 UTC (rev 13614)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/plugins/scmcvs/common/CVSPlugin.class.php	2011-02-28 01:47:21 UTC (rev 13615)
@@ -200,6 +200,10 @@
 			return false ;
 		}
 		
+		if (! $project->usesPlugin ($this->name)) {
+			return false;
+		}
+
 		if ($params['mode'] == 'day') {
 				db_begin();
 
@@ -212,6 +216,7 @@
 
 				$repo = $this->cvs_root . '/' . $project->getUnixName() ;
 				if (!is_dir ($repo) || !is_dir ("$repo/CVSROOT")) {
+					echo "No repository\n" ;
 					db_rollback () ;
 					return false ;
 				}
@@ -226,12 +231,14 @@
 				if (!file_exists($hist_file_path) 
 				    || !is_readable($hist_file_path)
 				    || filesize($hist_file_path) == 0) {
+					echo "No history file\n" ;
 					db_rollback () ;
 					return false ;
 				}
 				
 				$hist_file =& fopen( $hist_file_path, 'r' );
 				if ( ! $hist_file ) {
+					echo "Unreadable history\n" ;
 					db_rollback () ;
 					return false ;
 				}
@@ -242,6 +249,7 @@
 							       $day,
 							       $project->getID())) ;
 				if(!$res) {
+					echo "Error while cleaning stats_cvs_group\n" ;
 					db_rollback () ;
 					return false ;
 				}
@@ -251,6 +259,7 @@
 							       $day,
 							       $project->getID())) ;
 				if(!$res) {
+					echo "Error while cleaning stats_cvs_user\n" ;
 					db_rollback () ;
 					return false ;
 				}
@@ -294,6 +303,7 @@
 							     $cvs_co,
 							     $cvs_commit,
 							     $cvs_add))) {
+					echo "Error while inserting into stats_cvs_group\n" ;
 					db_rollback () ;
 					return false ;
 				}
@@ -318,10 +328,10 @@
 								     $user_id,
 								     $usr_commit{$user} ? $usr_commit{$user} : 0,
 								     $usr_add{$user} ? $usr_add{$user} : 0))) {
+						echo "Error while inserting into stats_cvs_user\n" ;
 						db_rollback () ;
 						return false ;
 					}
-			
 				}
 		}
 		db_commit();



More information about the evolvis-commits mailing list