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 865138e4779c86095ee14bcd5b7d2e2b6cf3f0cf (commit)
from 081905ade5f6e5f9224f22f83a9f38b544750e47 (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=865138e4779c86095ee14bcd5b7d2e2b6cf3f0cf
commit 865138e4779c86095ee14bcd5b7d2e2b6cf3f0cf
Author: Franck Villaume <[email protected]>
Date: Sun Mar 11 14:17:02 2018 +0100
scmsvn: allow user to specify topModule
diff --git a/src/plugins/scmsvn/common/SVNPlugin.class.php
b/src/plugins/scmsvn/common/SVNPlugin.class.php
index 272ebdb..7153e1c 100644
--- a/src/plugins/scmsvn/common/SVNPlugin.class.php
+++ b/src/plugins/scmsvn/common/SVNPlugin.class.php
@@ -100,15 +100,26 @@ some control over it to the project's administrator.");
}
function topModule($project) {
- // Check toplevel module presence
- $repo = 'file://' . forge_get_config('repos_path',
$this->name).'/'.$project->getUnixName().'/';
- $res = array ();
- $module = 'trunk';
- if (!(exec("svn ls '$repo'", $res) && in_array($module.'/',
$res))) {
- $module = '';
+ $scm_paths = array();
+ $scm_paths_file =
forge_get_config('groupdir_prefix').'/'.$project->getUnixName().'/'.$project->getUnixName().'_scmsvn_paths.txt';
+ if (file_exists($scm_paths_file)) {
+ $scm_paths = array_map("htmlentities",
file($scm_paths_file));
}
-
- return '/'.$module;
+ // Check scm_path module presence in repository
+ $modules = array();
+ foreach ($scm_paths as $scm_path) {
+ if (strpos($scm_path, "!") === false) {
+ $repo = 'file://' .
forge_get_config('repos_path', $this->name).'/'.$project->getUnixName();
+ $res = array();
+ if (!(exec("svn ls '$repo'", $res) &&
in_array($scm_path.'/', $res))) {
+ $modules[] = $scm_path;
+ }
+ }
+ }
+ if (count($modules) == 0) {
+ $modules[] = '';
+ }
+ return $modules;
}
function getInstructionsForAnon($project) {
@@ -118,23 +129,29 @@ some control over it to the project's administrator.");
$b .= '</p>';
$b .= '<p>' ;
- $module = $this->topModule($project);
- if (forge_get_config('use_ssh', 'scmsvn')) {
- $ssh_port = '';
- if (forge_get_config('ssh_port') != 22) {
- $ssh_port =
'--config-option="config:tunnels:ssh=ssh -p '.forge_get_config('ssh_port').'"';
+ $modules = $this->topModule($project);
+ foreach ($modules as $module) {
+ if (forge_get_config('use_ssh', 'scmsvn')) {
+ $ssh_port = '';
+ if (forge_get_config('ssh_port') != 22) {
+ $ssh_port =
'--config-option="config:tunnels:ssh=ssh -p '.forge_get_config('ssh_port').'"';
+ }
+ if (forge_get_config('use_shell_limited')) {
+ $b .= '<span class="tt">svn
'.$ssh_port.' checkout
svn://'.$this->getBoxForProject($project).'/'.$project->getUnixName().'/'.$module.'</span>'.html_e('br');
+ } else {
+ $b .= '<span class="tt">svn
'.$ssh_port.' checkout
svn://'.$this->getBoxForProject($project).$this->svn_root_fs.'/'.$project->getUnixName().'/'.$module.'</span>'.html_e('br');
+ }
+ }
+ if (forge_get_config('use_dav', 'scmsvn')) {
+ $b .= '<span class="tt">svn checkout
http'.((forge_get_config('use_ssl', 'scmsvn')) ? 's' :
'').'://'.$this->getBoxForProject($project).'/anonscm/svn/'.$project->getUnixName().'/'.$module.'</span>'.html_e('br');
}
- $b .= '<span class="tt">svn '.$ssh_port.' checkout
svn://'.$this->getBoxForProject($project).$this->svn_root_fs.'/'.$project->getUnixName().$module.'</span><br
/>';
- }
- if (forge_get_config('use_dav', 'scmsvn')) {
- $b .= '<p><span class="tt">svn checkout
http'.((forge_get_config('use_ssl', 'scmsvn')) ? 's' :
'').'://'.$this->getBoxForProject($project).'/anonscm/svn/'.$project->getUnixName().$module.'</span></p>'
;
}
$b .= '</p>';
return $b;
}
function getInstructionsForRW($project) {
- $module = $this->topModule($project);
+ $modules = $this->topModule($project);
$b = html_e('h2', array(), _('Developer Access'));
$b .= sprintf(_('Only project developers can access the %s tree
via this method.'), 'Subversion');
$b .= '<div id="tabber-svn">';
@@ -157,25 +174,29 @@ some control over it to the project's administrator.");
$b .= _('SSH must be installed on your client
machine.');
$b .= ' ';
$b .= _('Enter your site password when
prompted.');
- $b .= '</p>';
+ $b .= '</p><p>';
$ssh_port = '';
if (forge_get_config('ssh_port') != 22) {
$ssh_port =
'--config-option="config:tunnels:ssh=ssh -p '.forge_get_config('ssh_port').'" ';
}
- if (forge_get_config('use_shell_limited')) {
- $b .= '<p><span class="tt">svn
'.$ssh_port.'checkout
svn+ssh://'.$d.'@'.$this->getBoxForProject($project).'/'.$project->getUnixName().$module.'</span></p>'
;
- } else {
- $b .= '<p><span class="tt">svn
'.$ssh_port.'checkout
svn+ssh://'.$d.'@'.$this->getBoxForProject($project).$this->svn_root_fs .'/'.
$project->getUnixName().$module.'</span></p>' ;
+ foreach ($modules as $module) {
+ if
(forge_get_config('use_shell_limited')) {
+ $b .= '<span class="tt">svn
'.$ssh_port.'checkout
svn+ssh://'.$d.'@'.$this->getBoxForProject($project).'/'.$project->getUnixName().'/'.$module.'</span>'.html_e('br');
+ } else {
+ $b .= '<span class="tt">svn
'.$ssh_port.'checkout
svn+ssh://'.$d.'@'.$this->getBoxForProject($project).$this->svn_root_fs .'/'.
$project->getUnixName().'/'.$module.'</span>'.html_e('br');
+ }
}
- $b .= '</div>';
+ $b .= '</p></div>';
}
if (forge_get_config('use_dav', 'scmsvn')) {
$b .= '<div id="tabber-svndav"
class="tabbertab" >';
$b .= '<p>';
$b .= _('Enter your site password when
prompted.');
- $b .= '</p>';
- $b .= '<p><span class="tt">svn checkout
--username '.$d.' http'.((forge_get_config('use_ssl', 'scmsvn')) ? 's' :
'').'://'.$this->getBoxForProject($project).'/authscm/'.$d.'/svn/'.$project->getUnixName().$module.'</span></p>'
;
- $b .= '</div>';
+ $b .= '</p><p>';
+ foreach ($modules as $module) {
+ $b .= '<span class="tt">svn checkout
--username '.$d.' http'.((forge_get_config('use_ssl', 'scmsvn')) ? 's' :
'').'://'.$this->getBoxForProject($project).'/authscm/'.$d.'/svn/'.$project->getUnixName().'/'.$module.'</span>'.html_e('br');
+ }
+ $b .= '</p></div>';
}
} else {
if (forge_get_config('use_ssh', 'scmsvn')) {
@@ -186,17 +207,19 @@ some control over it to the project's administrator.");
$b .= _('Substitute <em>developername</em> with
the proper value.');
$b .= ' ';
$b .= _('Enter your site password when
prompted.');
- $b .= '</p>';
+ $b .= '</p><p>';
$ssh_port = '';
if (forge_get_config('ssh_port') != 22) {
$ssh_port =
'--config-option="config:tunnels:ssh=ssh -p '.forge_get_config('ssh_port').'" ';
}
- if (forge_get_config('use_shell_limited')) {
- $b .= '<p><span class="tt">svn
'.$ssh_port.'checkout
svn+ssh://<i>'._('developername').'</i>@'.$this->getBoxForProject($project).'/'.$project->getUnixName().$module.'</span></p>';
- } else {
- $b .= '<p><span class="tt">svn
'.$ssh_port.'checkout
svn+ssh://<i>'._('developername').'</i>@'.$this->getBoxForProject($project).$this->svn_root_fs
.'/'.$project->getUnixName().$module.'</span></p>';
+ foreach ($modules as $module) {
+ if
(forge_get_config('use_shell_limited')) {
+ $b .= '<span class="tt">svn
'.$ssh_port.'checkout
svn+ssh://<i>'._('developername').'</i>@'.$this->getBoxForProject($project).'/'.$project->getUnixName().'/'.$module.'</span>'.html_e('br');
+ } else {
+ $b .= '<span class="tt">svn
'.$ssh_port.'checkout
svn+ssh://<i>'._('developername').'</i>@'.$this->getBoxForProject($project).$this->svn_root_fs
.'/'.$project->getUnixName().'/'.$module.'</span>'.html_e('br');
+ }
}
- $b .= '</div>';
+ $b .= '</p></div>';
}
if (forge_get_config('use_dav', 'scmsvn')) {
$b .= '<div id="tabber-svndav"
class="tabbertab" >';
@@ -204,9 +227,11 @@ some control over it to the project's administrator.");
$b .= _('Substitute <em>developername</em> with
the proper value.');
$b .= ' ';
$b .= _('Enter your site password when
prompted.');
- $b .= '</p>';
- $b .= '<p><span class="tt">svn checkout
--username <i>'._('developername').'</i> http'.((forge_get_config('use_ssl',
'scmsvn')) ? 's' :
'').'://'.$this->getBoxForProject($project).'/authscm/<i>'._('developername').'</i>/svn/'.$project->getUnixName().$module.'</span></p>'
;
- $b .= '</div>';
+ $b .= '</p><p>';
+ foreach ($modules as $module) {
+ $b .= '<span class="tt">svn checkout
--username <i>'._('developername').'</i> http'.((forge_get_config('use_ssl',
'scmsvn')) ? 's' :
'').'://'.$this->getBoxForProject($project).'/authscm/<i>'._('developername').'</i>/svn/'.$project->getUnixName().'/'.$module.'</span>'.html_e('br');
+ }
+ $b .= '</p></div>';
}
}
$b .= '</div>';
-----------------------------------------------------------------------
Summary of changes:
src/plugins/scmsvn/common/SVNPlugin.class.php | 97 +++++++++++++++++----------
1 file changed, 61 insertions(+), 36 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits