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  6cfbe817b6536868f10e605b2ba42346c739f4e8 (commit)
      from  0c7c1f710709b0eb80cdd39cbd7ca431e3a58a23 (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=6cfbe817b6536868f10e605b2ba42346c739f4e8

commit 6cfbe817b6536868f10e605b2ba42346c739f4e8
Author: Franck Villaume <franck.villa...@trivialdev.com>
Date:   Sun Feb 11 13:50:42 2018 +0100

    remove first space in line... remove clone from WUI

diff --git a/src/plugins/scmhg/common/HgPlugin.class.php 
b/src/plugins/scmhg/common/HgPlugin.class.php
index be2c69e..65fad22 100644
--- a/src/plugins/scmhg/common/HgPlugin.class.php
+++ b/src/plugins/scmhg/common/HgPlugin.class.php
@@ -809,155 +809,124 @@ Offer DAV or SSH access.");
                return true;
        }
 
-       function scm_add_repo(&$params) {
-               $project = $this->checkParams($params);
-               if (!$project) {
-                       return false;
-               }
+       function scm_add_repo(&$params) {
+               $project = $this->checkParams($params);
+               if (!$project) {
+                       return false;
+               }
 
-               if (!isset($params['repo_name'])) {
-                       return false;
-               }
+               if (!isset($params['repo_name'])) {
+                       return false;
+               }
 
-               if ($params['repo_name'] == $project->getUnixName()) {
+               if ($params['repo_name'] == $project->getUnixName()) {
                        $params['error_msg'] = _('Cannot create a secondary 
repository with the same name as the primary');
-                       return false;
-               }
-
-               if (! util_is_valid_repository_name($params['repo_name'])) {
-                       $params['error_msg'] = _('This repository name is not 
valid');
-                       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')) {
-                       $params['error_msg'] = sprintf(_('A repository %s 
already exists'), $params['repo_name']);
-                       return false;
-               }
-
-               $description = '';
-               $clone = '';
-               if (isset($params['clone'])) {
-                       $url = $params['clone'];
-                       if ($url == '') {
-                               // Start from empty
-                               $clone = $url;
-                       } elseif (preg_match('|^https?://|', $url)) {
-                               // External URLs: OK
-                               $clone = $url;
-                       } elseif ($url == $project->getUnixName()) {
-                               $clone = $url;
-                       } elseif (($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($project->getID(),
-                                                                   $url,
-                                                                   
$this->getID())))
-                                 && db_result($result, 0, 'count')) {
-                               // Local repo: try to clone from an existing 
repo in same project
-                               // Repository found
-                               $clone = $url;
-                       } else {
-                               $params['error_msg'] = _('Invalid URL from 
which to clone');
-                               $clone = '';
-                               return false;
-                       }
-               }
-               if (isset($params['description'])) {
-                       $description = $params['description'];
-               }
-               if ($clone && !$description) {
-                       $description = sprintf(_('Clone of %s'), 
$params['clone']);
-               }
-               if (!$description) {
-                       $description = "Hg repository $params[repo_name] for 
project ".$project->getUnixName();
-               }
-
-               $result = db_query_params('INSERT INTO scm_secondary_repos 
(group_id, repo_name, description, clone_url, plugin_id) VALUES ($1, $2, $3, 
$4, $5)',
-                                          array($params['group_id'],
-                                                 $params['repo_name'],
-                                                 $description,
-                                                 $clone,
-                                                 $this->getID()));
-               if (! $result) {
-                       $params['error_msg'] = db_error();
-                       return false;
-               }
-
-               plugin_hook('scm_admin_update', $params);
-               return true;
-       }
-
-       function scm_admin_form(&$params) {
-               global $HTML;
-               $project = $this->checkParams($params);
-               if (!$project) {
-                       return false;
-               }
-
-               session_require_perm('project_admin', $params['group_id']);
-
-               $project_name = $project->getUnixName();
-               $result = db_query_params('SELECT repo_name, description, 
clone_url FROM scm_secondary_repos WHERE group_id=$1 AND next_action = $2 AND 
plugin_id=$3 ORDER BY repo_name',
-                                         array($params['group_id'],
-                                                SCM_EXTRA_REPO_ACTION_UPDATE,
-                                                $this->getID()));
-               if (!$result) {
-                       $params['error_msg'] = db_error();
-                       return false;
-               }
-               $existing_repos = array();
-               while($data = db_fetch_array($result)) {
-                       $existing_repos[] = array('repo_name' => 
$data['repo_name'],
-                                                 'description' => 
$data['description'],
-                                                 'clone_url' => 
$data['clone_url']);
-               }
-               if (count($existing_repos) == 0) {
-                       echo $HTML->information(_('No extra Hg repository for 
project').' '.$project_name);
-               } else {
-                       echo html_e('h2', array(), sprintf(ngettext('Extra Hg 
repository for project %1$s',
-                                                                       'Extra 
Hg repositories for project %1$s',
-                                                                       
count($existing_repos)), $project_name));
-                       $titleArr = array(_('Repository name'), ('Initial 
repository description'), _('Initial clone URL (if any)'), _('Delete'));
-                       echo $HTML->listTableTop($titleArr);
-                       foreach ($existing_repos as $key => $repo) {
-                               $cells = array();
-                               $cells[][] = html_e('kbd', array(), 
$repo['repo_name']);
-                               $cells[][] = $repo['description'];
-                               $cells[][] = $repo['clone_url'];
-                               $deleteForm = $HTML->openForm(array('name' => 
'form_delete_repo_'.$repo['repo_name'], 'action' => 
getStringFromServer('PHP_SELF'), 'method' => 'post'));
-                               $deleteForm .= html_e('input', array('type' => 
'hidden', 'name' => 'group_id', 'value' => $params['group_id']));
-                               $deleteForm .= html_e('input', array('type' => 
'hidden', 'name' => 'delete_repository', 'value' => 1));
-                               $deleteForm .= html_e('input', array('type' => 
'hidden', 'name' => 'repo_name', 'value' => $repo['repo_name']));
-                               $deleteForm .= html_e('input', array('type' => 
'hidden', 'name' => 'scm_enable_anonymous', 'value' => 
($project->enableAnonSCM()? 1 : 0)));
-                               $deleteForm .= html_e('input', array('type' => 
'submit', 'name' => 'submit', 'value' => _('Delete')));
-                               $deleteForm .= $HTML->closeForm();
-                               $cells[][] = $deleteForm;
-                               echo $HTML->multiTableRow(array(), $cells);
-                       }
-                       echo $HTML->listTableBottom();
-               }
-
-               echo html_e('h2', array(), sprintf(_('Create new Hg repository 
for project %s'), $project_name));
-               echo $HTML->openForm(array('name' => 'form_create_repo', 
'action' => getStringFromServer('PHP_SELF'), 'method' => 'post'));
-               echo html_e('input', array('type' => 'hidden', 'name' => 
'group_id', 'value' => $params['group_id']));
-               echo html_e('input', array('type' => 'hidden', 'name' => 
'create_repository', 'value' => 1));
-               echo html_e('p', array(), html_e('strong', array(), 
_('Repository name')._(':')).utils_requiredField().html_e('br').
-                               html_e('input', array('type' => 'text', 
'required' => 'required', 'size' => 20, 'name' => 'repo_name', 'value' => '')));
-               echo html_e('p', array(), html_e('strong', array(), 
_('Description')._(':')).html_e('br').
-                               html_e('input', array('type' => 'text', 'size' 
=> 60, 'name' => 'description', 'value' => '')));
-               echo html_e('p', array(), html_e('strong', array(), _('Initial 
clone URL (or name of an existing repository in this project; leave empty to 
start with an empty repository)')._(':')).html_e('br').
-                               html_e('input', array('type' => 'text', 'size' 
=> 60, 'name' => 'clone', 'value' => $project_name)));
-               echo html_e('input', array('type' => 'hidden', 'name' => 
'scm_enable_anonymous', 'value' => ($project->enableAnonSCM()? 1 : 0)));
-               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();
-       }
+                       return false;
+               }
+
+               if (! util_is_valid_repository_name($params['repo_name'])) {
+                       $params['error_msg'] = _('This repository name is not 
valid');
+                       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')) {
+                       $params['error_msg'] = sprintf(_('A repository %s 
already exists'), $params['repo_name']);
+                       return false;
+               }
+
+               $description = '';
+               $clone = '';
+               if (isset($params['description'])) {
+                       $description = $params['description'];
+               }
+               if (!$description) {
+                       $description = "Hg repository $params[repo_name] for 
project ".$project->getUnixName();
+               }
+
+               $result = db_query_params('INSERT INTO scm_secondary_repos 
(group_id, repo_name, description, clone_url, plugin_id) VALUES ($1, $2, $3, 
$4, $5)',
+                                          array($params['group_id'],
+                                                 $params['repo_name'],
+                                                 $description,
+                                                 $clone,
+                                                 $this->getID()));
+               if (! $result) {
+                       $params['error_msg'] = db_error();
+                       return false;
+               }
+
+               plugin_hook('scm_admin_update', $params);
+               return true;
+       }
+
+       function scm_admin_form(&$params) {
+               global $HTML;
+               $project = $this->checkParams($params);
+               if (!$project) {
+                       return false;
+               }
+
+               session_require_perm('project_admin', $params['group_id']);
+
+               $project_name = $project->getUnixName();
+               $result = db_query_params('SELECT repo_name, description FROM 
scm_secondary_repos WHERE group_id=$1 AND next_action = $2 AND plugin_id=$3 
ORDER BY repo_name',
+                                         array($params['group_id'],
+                                                SCM_EXTRA_REPO_ACTION_UPDATE,
+                                                $this->getID()));
+               if (!$result) {
+                       $params['error_msg'] = db_error();
+                       return false;
+               }
+               $existing_repos = array();
+               while($data = db_fetch_array($result)) {
+                       $existing_repos[] = array('repo_name' => 
$data['repo_name'],
+                                                 'description' => 
$data['description'],
+               }
+               if (count($existing_repos) == 0) {
+                       echo $HTML->information(_('No extra Hg repository for 
project').' '.$project_name);
+               } else {
+                       echo html_e('h2', array(), sprintf(ngettext('Extra Hg 
repository for project %1$s',
+                                                                       'Extra 
Hg repositories for project %1$s',
+                                                                       
count($existing_repos)), $project_name));
+                       $titleArr = array(_('Repository name'), ('Initial 
repository description'), _('Delete'));
+                       echo $HTML->listTableTop($titleArr);
+                       foreach ($existing_repos as $key => $repo) {
+                               $cells = array();
+                               $cells[][] = html_e('kbd', array(), 
$repo['repo_name']);
+                               $cells[][] = $repo['description'];
+                               $deleteForm = $HTML->openForm(array('name' => 
'form_delete_repo_'.$repo['repo_name'], 'action' => 
getStringFromServer('PHP_SELF'), 'method' => 'post'));
+                               $deleteForm .= html_e('input', array('type' => 
'hidden', 'name' => 'group_id', 'value' => $params['group_id']));
+                               $deleteForm .= html_e('input', array('type' => 
'hidden', 'name' => 'delete_repository', 'value' => 1));
+                               $deleteForm .= html_e('input', array('type' => 
'hidden', 'name' => 'repo_name', 'value' => $repo['repo_name']));
+                               $deleteForm .= html_e('input', array('type' => 
'hidden', 'name' => 'scm_enable_anonymous', 'value' => 
($project->enableAnonSCM()? 1 : 0)));
+                               $deleteForm .= html_e('input', array('type' => 
'submit', 'name' => 'submit', 'value' => _('Delete')));
+                               $deleteForm .= $HTML->closeForm();
+                               $cells[][] = $deleteForm;
+                               echo $HTML->multiTableRow(array(), $cells);
+                       }
+                       echo $HTML->listTableBottom();
+               }
+
+               echo html_e('h2', array(), sprintf(_('Create new Hg repository 
for project %s'), $project_name));
+               echo $HTML->openForm(array('name' => 'form_create_repo', 
'action' => getStringFromServer('PHP_SELF'), 'method' => 'post'));
+               echo html_e('input', array('type' => 'hidden', 'name' => 
'group_id', 'value' => $params['group_id']));
+               echo html_e('input', array('type' => 'hidden', 'name' => 
'create_repository', 'value' => 1));
+               echo html_e('p', array(), html_e('strong', array(), 
_('Repository name')._(':')).utils_requiredField().html_e('br').
+                               html_e('input', array('type' => 'text', 
'required' => 'required', 'size' => 20, 'name' => 'repo_name', 'value' => '')));
+               echo html_e('p', array(), html_e('strong', array(), 
_('Description')._(':')).html_e('br').
+                               html_e('input', array('type' => 'text', 'size' 
=> 60, 'name' => 'description', 'value' => '')));
+               echo html_e('input', array('type' => 'hidden', 'name' => 
'scm_enable_anonymous', 'value' => ($project->enableAnonSCM()? 1 : 0)));
+               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();
+       }
 
        function getRepositories($group, $autoinclude = true) {
                $repoarr = array();

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

Summary of changes:
 src/plugins/scmhg/common/HgPlugin.class.php | 261 ++++++++++++----------------
 1 file changed, 115 insertions(+), 146 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
Fusionforge-commits@lists.fusionforge.org
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to