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 12c7437f5cee524970aa89b20fc6052fe66c7d89 (commit)
from 145d14ff2cb1ce69afba5731577ba1be210840cf (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=12c7437f5cee524970aa89b20fc6052fe66c7d89
commit 12c7437f5cee524970aa89b20fc6052fe66c7d89
Author: Franck Villaume <[email protected]>
Date: Sun Feb 11 18:18:44 2018 +0100
scmhook: make it allow_multiple_scm friendly: start
diff --git a/src/plugins/scmcvs/common/CVSPlugin.class.php
b/src/plugins/scmcvs/common/CVSPlugin.class.php
index fda3b17..37027fe 100644
--- a/src/plugins/scmcvs/common/CVSPlugin.class.php
+++ b/src/plugins/scmcvs/common/CVSPlugin.class.php
@@ -37,9 +37,10 @@ class CVSPlugin extends SCMPlugin {
_("This plugin contains the CVS subsystem of FusionForge. It allows each
FusionForge project to have its own CVS repository, and gives some control
over it to the project's administrator.");
- $this->hooks[] = 'scm_browser_page';
- $this->hooks[] = 'scm_generate_snapshots';
- $this->hooks[] = 'scm_gather_stats';
+ $this->_addHook('scm_admin_form');
+ $this->_addHook('scm_browser_page');
+ $this->_addHook('scm_generate_snapshots');
+ $this->_addHook('scm_gather_stats');
$this->provides['cvs'] = true;
@@ -510,6 +511,10 @@ over it to the project's administrator.");
if (forge_get_config('allow_multiple_scm') &&
($params['allow_multiple_scm'] > 1)) {
echo html_ao('div', array('id' =>
'tabber-'.$this->name, 'class' => 'tabbertab'));
}
+ if ($project->usesPlugin('scmhook')) {
+ $scmhookPlugin = plugin_get_object('scmhook');
+ $scmhookPlugin->displayScmHook($project->getID(),
$this->name);
+ }
if (forge_get_config('allow_multiple_scm') &&
($params['allow_multiple_scm'] > 1)) {
echo html_ac(html_ap() - 1);
}
diff --git a/src/plugins/scmgit/common/GitPlugin.class.php
b/src/plugins/scmgit/common/GitPlugin.class.php
index 12ee188..e49b225 100644
--- a/src/plugins/scmgit/common/GitPlugin.class.php
+++ b/src/plugins/scmgit/common/GitPlugin.class.php
@@ -1208,6 +1208,11 @@ control over it to the project's administrator.");
echo $HTML->html_input('cancel', '', '', 'submit', _('Cancel'),
array(), array('style' => 'display: inline-block!important'));
echo $HTML->html_input('submit', '', '', 'submit', _('Submit'),
array(), array('style' => 'display: inline-block!important'));
echo $HTML->closeForm();
+
+ if ($project->usesPlugin('scmhook')) {
+ $scmhookPlugin = plugin_get_object('scmhook');
+ $scmhookPlugin->displayScmHook($project->getID(),
$this->name);
+ }
if (forge_get_config('allow_multiple_scm') &&
($params['allow_multiple_scm'] > 1)) {
echo html_ac(html_ap() - 1);
}
diff --git a/src/plugins/scmhg/common/HgPlugin.class.php
b/src/plugins/scmhg/common/HgPlugin.class.php
index 7b1ef11..4387ed0 100644
--- a/src/plugins/scmhg/common/HgPlugin.class.php
+++ b/src/plugins/scmhg/common/HgPlugin.class.php
@@ -929,6 +929,10 @@ Offer DAV or SSH access.");
echo html_e('input', array('type' => 'submit', 'name' =>
'cancel', 'value' => _('Cancel')));
echo html_e('input', array('type' => 'submit', 'name' =>
'submit', 'value' => _('Submit')));
echo $HTML->closeForm();
+ if ($project->usesPlugin('scmhook')) {
+ $scmhookPlugin = plugin_get_object('scmhook');
+ $scmhookPlugin->displayScmHook($project->getID(),
$this->name);
+ }
if (forge_get_config('allow_multiple_scm') &&
($params['allow_multiple_scm'] > 1)) {
echo html_ac(html_ap() - 1);
}
diff --git a/src/plugins/scmhook/common/scmhookPlugin.class.php
b/src/plugins/scmhook/common/scmhookPlugin.class.php
index e7ac8e9..b584de4 100644
--- a/src/plugins/scmhook/common/scmhookPlugin.class.php
+++ b/src/plugins/scmhook/common/scmhookPlugin.class.php
@@ -44,7 +44,6 @@ project independently.");
$this->_addHook('groupisactivecheckbox'); // The "use
..." checkbox in editgroupinfo
}
$this->_addHook('groupisactivecheckboxpost'); //
- $this->_addHook('scm_admin_page');
$this->_addHook('scm_admin_update');
$this->_addHook('artifact_extra_detail');
$this->_addHook('task_extra_detail');
@@ -52,15 +51,6 @@ project independently.");
function CallHook($hookname, &$params) {
switch ($hookname) {
- case 'scm_admin_page': {
- $group_id = $params['group_id'];
- $scm_plugin = $params['scm_plugin'];
- $group = group_get_object($group_id);
- if ($group->usesPlugin($this->name) &&
$scm_plugin) {
- $this->displayScmHook($group_id,
$scm_plugin);
- }
- break;
- }
case 'scm_admin_update': {
$this->update($params);
break;
@@ -199,8 +189,7 @@ project independently.");
$hooksEnabled = $this->getEnabledHooks($group_id);
if (count($hooksAvailable)) {
echo '<div id="scmhook">';
-
- echo '<h2>'._('Enable Repository Hooks').'</h2>';
+ echo html_e('h2', array(), _('Enable Repository
Hooks'));
switch ($scm) {
case "scmsvn": {
$this->displayScmSvnHook($hooksAvailable, $hooksEnabled, $group_id);
@@ -238,14 +227,15 @@ project independently.");
}
function getAvailableHooks($group_id) {
+ $available_hooks = array();
$listScm = $this->getListLibraryScm();
$group = group_get_object($group_id);
for ($i = 0; $i < count($listScm); $i++) {
if ($group->usesPlugin($listScm[$i])) {
- return $this->getListLibraryHook($listScm[$i]);
+ $available_hooks =
array_merge($available_hooks, $this->getListLibraryHook($listScm[$i]));
}
}
- return array();
+ return $available_hooks;
}
function getEnabledHooks($group_id) {
@@ -324,13 +314,15 @@ project independently.");
// Group available hooks by type
$hooks_by_type = array();
foreach ($hooksAvailable as $hook)
- $hooks_by_type[$hook->getHookType()][] = $hook;
+ if ($hook->label == 'scmsvn') {
+ $hooks_by_type[$hook->getHookType()][] = $hook;
+ }
// Display available hooks, in specific order
foreach (array('pre-commit', 'pre-revprop-change',
'post-commit') as $hooktype) {
$hooks = $hooks_by_type[$hooktype];
if (count($hooks)) {
echo html_e('h3', array(), sprintf(_('%s
Hooks'), $hooktype), false);
- $tabletop = array('', _('Hook'),
_('Description'));
+ $tabletop = array('', _('Hook Name'),
_('Description'));
$classth = array('unsortable', '', '');
echo $HTML->listTableTop($tabletop, array(),
"sortable_scmhook_$hooktype", 'sortable', $classth);
foreach ($hooks as $hook) {
@@ -383,14 +375,16 @@ project independently.");
global $HTML;
$hooksServePushPullBundle = array();
foreach ($hooksAvailable as $hook) {
- switch ($hook->getHookType()) {
- case "serve-push-pull-bundle": {
- $hooksServePushPullBundle[] = $hook;
- break;
- }
- default: {
- //byebye hook.... we do not know you...
- break;
+ if ($hook->label == 'scmhg') {
+ switch ($hook->getHookType()) {
+ case "serve-push-pull-bundle": {
+ $hooksServePushPullBundle[] =
$hook;
+ break;
+ }
+ default: {
+ //byebye hook.... we do not
know you...
+ break;
+ }
}
}
}
@@ -433,14 +427,16 @@ project independently.");
global $HTML;
$hooksPostReceive = array();
foreach ($hooksAvailable as $hook) {
- switch ($hook->getHookType()) {
- case "post-receive": {
- $hooksPostReceive[] = $hook;
- break;
- }
- default: {
- //byebye hook.... we do not know you...
- break;
+ if ($hook->label == 'scmgit') {
+ switch ($hook->getHookType()) {
+ case "post-receive": {
+ $hooksPostReceive[] = $hook;
+ break;
+ }
+ default: {
+ //byebye hook.... we do not
know you...
+ break;
+ }
}
}
}
@@ -483,14 +479,16 @@ project independently.");
global $HTML;
$hooksPostCommit = array();
foreach ($hooksAvailable as $hook) {
- switch ($hook->getHookType()) {
- case "post-commit": {
- $hooksPostCommit[] = $hook;
- break;
- }
- default: {
- //byebye hook.... we do not know you...
- break;
+ if ($hook->label == 'scmcvs') {
+ switch ($hook->getHookType()) {
+ case "post-commit": {
+ $hooksPostCommit[] = $hook;
+ break;
+ }
+ default: {
+ //byebye hook.... we do not
know you...
+ break;
+ }
}
}
}
diff --git a/src/plugins/scmsvn/common/SVNPlugin.class.php
b/src/plugins/scmsvn/common/SVNPlugin.class.php
index 84da697..30ea420 100644
--- a/src/plugins/scmsvn/common/SVNPlugin.class.php
+++ b/src/plugins/scmsvn/common/SVNPlugin.class.php
@@ -48,9 +48,9 @@ class SVNPlugin extends SCMPlugin {
_("This plugin contains the Subversion subsystem of FusionForge. It allows
each FusionForge project to have its own Subversion repository, and gives
some control over it to the project's administrator.");
- $this->svn_root_fs = forge_get_config('repos_path',
-
$this->name);
+ $this->svn_root_fs = forge_get_config('repos_path',
$this->name);
$this->svn_root_dav = '/svn';
+ $this->_addHook('scm_admin_form');
$this->_addHook('scm_browser_page');
$this->_addHook('scm_update_repolist');
$this->_addHook('scm_regen_apache_auth');
@@ -884,6 +884,10 @@ some control over it to the project's administrator.");
if (forge_get_config('allow_multiple_scm') &&
($params['allow_multiple_scm'] > 1)) {
echo html_ao('div', array('id' =>
'tabber-'.$this->name, 'class' => 'tabbertab'));
}
+ if ($project->usesPlugin('scmhook')) {
+ $scmhookPlugin = plugin_get_object('scmhook');
+ $scmhookPlugin->displayScmHook($project->getID(),
$this->name);
+ }
if (forge_get_config('allow_multiple_scm') &&
($params['allow_multiple_scm'] > 1)) {
echo html_ac(html_ap() - 1);
}
-----------------------------------------------------------------------
Summary of changes:
src/plugins/scmcvs/common/CVSPlugin.class.php | 11 ++-
src/plugins/scmgit/common/GitPlugin.class.php | 5 ++
src/plugins/scmhg/common/HgPlugin.class.php | 4 ++
src/plugins/scmhook/common/scmhookPlugin.class.php | 78 +++++++++++-----------
src/plugins/scmsvn/common/SVNPlugin.class.php | 8 ++-
5 files changed, 61 insertions(+), 45 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits