[Fusionforge-commits] FusionForge branch 6.1 updated. v6.1beta1-157-ga3b5eb4

Franck Villaume nerville at libremir.placard.fr.eu.org
Thu Feb 15 21:04:47 CET 2018


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, 6.1 has been updated
       via  a3b5eb4d1d11d5b1c43715215a98db5c377b6a33 (commit)
       via  8265a2e5493ea47ab37a605df890a0006233f61a (commit)
       via  ad332fd161ed79dbfa68ffb8aa9a81bf6d93cd50 (commit)
       via  c0b3922f674724ea4d746052f70932ca4eb699e0 (commit)
      from  45083485a0a78fa6e2544c08a03edfdcaafa7184 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=a3b5eb4d1d11d5b1c43715215a98db5c377b6a33

commit a3b5eb4d1d11d5b1c43715215a98db5c377b6a33
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 15 21:04:27 2018 +0100

    scmhook: multirepo backend implement + php fix

diff --git a/src/plugins/scmhook/common/scmhookPlugin.class.php b/src/plugins/scmhook/common/scmhookPlugin.class.php
index c4668f8..8ccc279 100644
--- a/src/plugins/scmhook/common/scmhookPlugin.class.php
+++ b/src/plugins/scmhook/common/scmhookPlugin.class.php
@@ -249,7 +249,7 @@ project independently.");
 			return $enabledHooks;
 
 		while ($arr = db_fetch_array($res)) {
-			$enabledHooks[$row['repository_name']] = explode('|', $row['hooks']);
+			$enabledHooks[$arr['repository_name']] = explode('|', $arr['hooks']);
 		}
 		return $enabledHooks;
 	}
@@ -420,7 +420,7 @@ project independently.");
 							$attr = array_merge($attr, array('title' => $hookServePushPullBundle->getDisabledMessage()));
 						}
 					}
-					if (in_array($hookServePushPullBundle->getName(), $hooksEnabled[$repository])) {
+					if (isset($hooksEnabled[$repository]) && in_array($hookServePushPullBundle->getName(), $hooksEnabled[$repository])) {
 						$attr = array_merge($attr, array('checked' => 'checked'));
 					}
 					$cells[][] = html_e('input', array('type' => 'checkbox', 'name' => $hookServePushPullBundle->getLabel().'_'.$hookServePushPullBundle->getClassname(), 'value' => $repository));
diff --git a/src/plugins/scmhook/db/20180215-plugin_scmhook_multirepo_support.sql b/src/plugins/scmhook/db/20180215-plugin_scmhook_multirepo_support.sql
new file mode 100644
index 0000000..89c1490
--- /dev/null
+++ b/src/plugins/scmhook/db/20180215-plugin_scmhook_multirepo_support.sql
@@ -0,0 +1,2 @@
+ALTER TABLE plugin_scmhook ADD COLUMN repository_name text;
+UPDATE plugin_scmhook SET repository_name = (SELECT unix_group_name FROM groups,plugin_scmhook WHERE groups.group_id = plugin_scmhook.id_group);

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=8265a2e5493ea47ab37a605df890a0006233f61a

commit 8265a2e5493ea47ab37a605df890a0006233f61a
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 15 20:43:19 2018 +0100

    scmhook: prepare multirepo scmhg support

diff --git a/src/plugins/scmhook/common/scmhookPlugin.class.php b/src/plugins/scmhook/common/scmhookPlugin.class.php
index bf63023..c4668f8 100644
--- a/src/plugins/scmhook/common/scmhookPlugin.class.php
+++ b/src/plugins/scmhook/common/scmhookPlugin.class.php
@@ -109,6 +109,7 @@ project independently.");
 
 	function update($params) {
 		$group_id = $params['group_id'];
+		$repository_name = $params['repository_name'];
 
                 $group = group_get_object($group_id);
                 if (!$group->usesPlugin($this->name))
@@ -129,8 +130,8 @@ project independently.");
 				}
 			}
 		}
-		$res = db_query_params('UPDATE plugin_scmhook set hooks = $1, need_update = 1 where id_group = $2',
-				       array(implode('|', $enabled_hooknames), $group_id));
+		$res = db_query_params('UPDATE plugin_scmhook set hooks = $1, need_update = 1 where id_group = $2 and repository_name = $3',
+				       array(implode('|', $enabled_hooknames), $group_id, $repository_name));
 
 		// Save parameters
 		foreach($hooks as $hook) {
@@ -314,6 +315,9 @@ project independently.");
 
 	function displayScmSvnHook($hooksAvailable, $hooksEnabled, $group_id) {
 		global $HTML;
+		$scm_plugin = plugin_get_object('scmsvn');
+		$groupObject = group_get_object($group_id);
+		$repositories = $scm_plugin->getRepositories($groupObject);
 		// Group available hooks by type
 		$hooks_by_type = array();
 		foreach ($hooksAvailable as $hook)
@@ -376,6 +380,9 @@ project independently.");
 
 	function displayScmHgHook($hooksAvailable, $hooksEnabled, $group_id) {
 		global $HTML;
+		$scm_plugin = plugin_get_object('scmhg');
+		$groupObject = group_get_object($group_id);
+		$repositories = $scm_plugin->getRepositories($groupObject);
 		$hooksServePushPullBundle = array();
 		foreach ($hooksAvailable as $hook) {
 			if ($hook->label == 'scmhg') {
@@ -392,35 +399,33 @@ project independently.");
 			}
 		}
 		if (count($hooksServePushPullBundle)) {
-			echo html_e('h3', array(), _('serve-push-pull-bundle Hooks'), false);
-			$tabletop = array('', _('Hook Name'), _('Description'));
-			$classth = array('unsortable', '', '');
-			echo $HTML->listTableTop($tabletop, array(), 'sortable_scmhook_serve-push-pull-bundle', 'sortable', $classth);
+			$tabletop = array(_('Repository'));
+			$classth = array('');
+			$titleArr = array('');
 			foreach ($hooksServePushPullBundle as $hookServePushPullBundle) {
-				if (! empty($hookServePushPullBundle->onlyGlobalAdmin) && ! Permission::isGlobalAdmin()) {
-					echo '<tr class="hide" ><td>';
-				}
-				else {
-					echo '<tr><td>';
-				}
-				echo '<input type="checkbox" ';
-				echo 'name="'.$hookServePushPullBundle->getLabel().'_'.$hookServePushPullBundle->getClassname().'" ';
-				if (in_array($hookServePushPullBundle->getClassname(), $hooksEnabled))
-					echo ' checked="checked"';
-
-				if (!$hookServePushPullBundle->isAvailable())
-					echo ' disabled="disabled"';
-
-				echo ' />';
-				echo '</td><td';
-				if (!$hookServePushPullBundle->isAvailable())
-					echo ' title="'.$hookServePushPullBundle->getDisabledMessage().'"';
+				$tabletop[] = $hookServePushPullBundle->getName();
+				$classth[] = 'unsortable';
+				$titleArr[] = $hookServePushPullBundle->getDescription();
+			}
 
-				echo ' >';
-				echo $hookServePushPullBundle->getName();
-				echo '</td><td>';
-				echo $hookServePushPullBundle->getDescription();
-				echo '</td></tr>';
+			echo $HTML->listTableTop($tabletop, '', 'sortable_scmhook_scmhg', 'sortable', $classth, $titleArr);
+			foreach($repositories as $repository) {
+				$cells = array();
+				$cells[][] = $repository;
+				foreach ($hooksServePushPullBundle as $hookServePushPullBundle) {
+					$attr = array('type' => 'checkbox');
+					if ((!empty($hookServePushPullBundle->onlyGlobalAdmin) && !Permission::isGlobalAdmin()) || !$hookServePushPullBundle->isAvailable()) {
+						$attr = array_merge($attr, array('disabled' => 'disabled'));
+						if (!$hookServePushPullBundle->isAvailable()) {
+							$attr = array_merge($attr, array('title' => $hookServePushPullBundle->getDisabledMessage()));
+						}
+					}
+					if (in_array($hookServePushPullBundle->getName(), $hooksEnabled[$repository])) {
+						$attr = array_merge($attr, array('checked' => 'checked'));
+					}
+					$cells[][] = html_e('input', array('type' => 'checkbox', 'name' => $hookServePushPullBundle->getLabel().'_'.$hookServePushPullBundle->getClassname(), 'value' => $repository));
+				}
+				echo $HTML->multiTableRow(array(), $cells);
 			}
 			echo $HTML->listTableBottom();
 		}

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=ad332fd161ed79dbfa68ffb8aa9a81bf6d93cd50

commit ad332fd161ed79dbfa68ffb8aa9a81bf6d93cd50
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 15 20:42:31 2018 +0100

    generic getRepositories for any SCM plugin

diff --git a/src/common/include/SCMPlugin.class.php b/src/common/include/SCMPlugin.class.php
index 73ba5fd..f056b98 100644
--- a/src/common/include/SCMPlugin.class.php
+++ b/src/common/include/SCMPlugin.class.php
@@ -347,6 +347,14 @@ abstract class SCMPlugin extends Plugin {
 
 		return $project;
 	}
+
+	function getRepositories($group, $autoinclude = true) {
+		$repoarr = array();
+		if ($autoinclude) {
+			$repoarr[] = $group->getUnixName();
+		}
+		return $repoarr;
+	}
 }
 
 // Local Variables:

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=c0b3922f674724ea4d746052f70932ca4eb699e0

commit c0b3922f674724ea4d746052f70932ca4eb699e0
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 15 20:41:54 2018 +0100

    tabs

diff --git a/src/plugins/scmhook/www/committracker/newcommit.php b/src/plugins/scmhook/www/committracker/newcommit.php
index fffbef4..dc7dba9 100644
--- a/src/plugins/scmhook/www/committracker/newcommit.php
+++ b/src/plugins/scmhook/www/committracker/newcommit.php
@@ -124,8 +124,8 @@ function parseConfig(&$Config) {
 function addArtifactLog($Config, $GroupId, $Num) {
 	$return = array();
 	$Result = db_query_params ('SELECT * FROM artifact,artifact_group_list WHERE
-artifact.group_artifact_id=artifact_group_list.group_artifact_id
-AND artifact_group_list.group_id=$1 AND artifact.artifact_id=$2',
+					artifact.group_artifact_id=artifact_group_list.group_artifact_id
+					AND artifact_group_list.group_id=$1 AND artifact.artifact_id=$2',
 				   array ($GroupId,
 					  $Num));
 	$Rows = db_numrows($Result);
@@ -136,8 +136,8 @@ AND artifact_group_list.group_id=$1 AND artifact.artifact_id=$2',
 	if ($Rows == 1) {
 		db_begin();
 		$DBRes = db_query_params ('INSERT INTO plugin_scmhook_scmsvn_committracker_data_artifact
-(kind, group_artifact_id) VALUES
-(0, $1)',
+						(kind, group_artifact_id) VALUES
+						(0, $1)',
 					  array ($Num));
 		$HolderID= db_insertid($DBRes,'plugin_scmhook_scmsvn_committracker_data_artifact','id');
 		if (!$DBRes || !$HolderID) {

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

Summary of changes:
 src/common/include/SCMPlugin.class.php             |  8 +++
 src/plugins/scmhook/common/scmhookPlugin.class.php | 65 ++++++++++++----------
 .../20180215-plugin_scmhook_multirepo_support.sql  |  2 +
 .../scmhook/www/committracker/newcommit.php        |  8 +--
 4 files changed, 49 insertions(+), 34 deletions(-)
 create mode 100644 src/plugins/scmhook/db/20180215-plugin_scmhook_multirepo_support.sql


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list