[Fusionforge-commits] FusionForge branch master updated. e255776df32d4d94a2ec1f6368844d0e4984ff0c

Roland Mas lolando at fusionforge.org
Fri Nov 23 14:11:38 CET 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  e255776df32d4d94a2ec1f6368844d0e4984ff0c (commit)
      from  b7d01ebdff022176d0ba63eda684577b103b74a6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e255776df32d4d94a2ec1f6368844d0e4984ff0c
Author: Roland Mas <lolando at debian.org>
Date:   Fri Nov 23 14:11:29 2012 +0100

    Moved generic code to the generic class

diff --git a/src/common/include/SCMPlugin.class.php b/src/common/include/SCMPlugin.class.php
index 7c26551..251c6a9 100644
--- a/src/common/include/SCMPlugin.class.php
+++ b/src/common/include/SCMPlugin.class.php
@@ -288,6 +288,64 @@ abstract class SCMPlugin extends Plugin {
 		return $box;
 	}
 
+	function scm_delete_repo(&$params) {
+		$project = $this->checkParams($params);
+		if (!$project) {
+			return false ;
+		}
+		if (! $project->usesPlugin ($this->name)) {
+			return false;
+		}
+
+		if (!isset($params['repo_name'])) {
+			return false;
+		}
+
+		$result = db_query_params('SELECT count(*) AS count FROM scm_secondary_repos WHERE group_id=$1 AND repo_name = $2 AND plugin_id=$3',
+					  array ($params['group_id'],
+						 $params['repo_name'],
+						 $this->getID()));
+		if (! $result) {
+			$params['error_msg'] = db_error();
+			return false;
+		}
+		if (db_result($result, 0, 'count') == 0) {
+			$params['error_msg'] = sprintf(_('No repository %s exists'), $params['repo_name']);
+			return false;
+		}
+
+		$result = db_query_params ('UPDATE scm_secondary_repos SET next_action = $1 WHERE group_id=$2 AND repo_name=$3 AND plugin_id=$4',
+					   array (SCM_EXTRA_REPO_ACTION_DELETE,
+						  $params['group_id'],
+						  $params['repo_name'],
+						  $this->getID()));
+		if (! $result) {
+			$params['error_msg'] = db_error();
+			return false;
+		}
+
+		plugin_hook ("scm_admin_update", $params);
+		return true;
+	}
+
+	function scm_admin_buttons(&$params) {
+		$project = $this->checkParams($params);
+		if (!$project) {
+			return false ;
+		}
+		if (! $project->usesPlugin ($this->name)) {
+			return false;
+		}
+
+		global $HTML;
+
+		$HTML->addButtons(
+				'/scm/admin/?group_id='.$params['group_id'].'&form_create_repo=1',
+				_("Add Repository"),
+				array('icon' => html_image('ic/scm_repo_add.png'))
+		);
+	}
+
 	function checkParams ($params) {
 		$group_id = $params['group_id'] ;
 		$project = group_get_object($group_id);
diff --git a/src/plugins/scmgit/common/GitPlugin.class.php b/src/plugins/scmgit/common/GitPlugin.class.php
index 95ce8a3..d59b464 100644
--- a/src/plugins/scmgit/common/GitPlugin.class.php
+++ b/src/plugins/scmgit/common/GitPlugin.class.php
@@ -951,64 +951,6 @@ class GitPlugin extends SCMPlugin {
 		return true;
 	}
 
-	function scm_delete_repo(&$params) {
-		$project = $this->checkParams($params);
-		if (!$project) {
-			return false ;
-		}
-		if (! $project->usesPlugin ($this->name)) {
-			return false;
-		}
-
-		if (!isset($params['repo_name'])) {
-			return false;
-		}
-
-		$result = db_query_params('SELECT count(*) AS count FROM scm_secondary_repos WHERE group_id=$1 AND repo_name = $2 AND plugin_id=$3',
-					  array ($params['group_id'],
-						 $params['repo_name'],
-						 $this->getID()));
-		if (! $result) {
-			$params['error_msg'] = db_error();
-			return false;
-		}
-		if (db_result($result, 0, 'count') == 0) {
-			$params['error_msg'] = sprintf(_('No repository %s exists'), $params['repo_name']);
-			return false;
-		}
-
-		$result = db_query_params ('UPDATE scm_secondary_repos SET next_action = $1 WHERE group_id=$2 AND repo_name=$3 AND plugin_id=$4',
-					   array (SCM_EXTRA_REPO_ACTION_DELETE,
-						  $params['group_id'],
-						  $params['repo_name'],
-						  $this->getID()));
-		if (! $result) {
-			$params['error_msg'] = db_error();
-			return false;
-		}
-
-		plugin_hook ("scm_admin_update", $params);
-		return true;
-	}
-
-	function scm_admin_buttons(&$params) {
-		$project = $this->checkParams($params);
-		if (!$project) {
-			return false ;
-		}
-		if (! $project->usesPlugin ($this->name)) {
-			return false;
-		}
-
-		global $HTML;
-
-		$HTML->addButtons(
-				'/scm/admin/?group_id='.$params['group_id'].'&form_create_repo=1',
-				_("Add Repository"),
-				array('icon' => html_image('ic/scm_repo_add.png'))
-		);
-	}
-
 	function scm_admin_form(&$params) {
 		$project = $this->checkParams($params);
 		if (!$project) {

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/SCMPlugin.class.php        |   58 +++++++++++++++++++++++++
 src/plugins/scmgit/common/GitPlugin.class.php |   58 -------------------------
 2 files changed, 58 insertions(+), 58 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list