Added a simpler way to configure the repositories.
This commit is contained in:
@@ -43,11 +43,7 @@ class IDF_Scm_Git
|
||||
*/
|
||||
public static function getRemoteAccessUrl($project)
|
||||
{
|
||||
$url = Pluf::f('git_remote_url');
|
||||
if (Pluf::f('git_repositories_unique', true)) {
|
||||
return $url;
|
||||
}
|
||||
return $url.'/'.$project->shortname.'.git';
|
||||
return sprintf(Pluf::f('git_remote_url'), $project->shortname);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,10 +54,7 @@ class IDF_Scm_Git
|
||||
*/
|
||||
public static function factory($project)
|
||||
{
|
||||
$rep = Pluf::f('git_repositories');
|
||||
if (false == Pluf::f('git_repositories_unique', false)) {
|
||||
$rep = $rep.'/'.$project->shortname.'.git';
|
||||
}
|
||||
$rep = sprintf(Pluf::f('git_repositories'), $project->shortname);
|
||||
return new IDF_Scm_Git($rep);
|
||||
}
|
||||
|
||||
|
@@ -42,11 +42,7 @@ class IDF_Scm_Mercurial
|
||||
*/
|
||||
public static function getRemoteAccessUrl($project)
|
||||
{
|
||||
$url = Pluf::f('mercurial_remote_url');
|
||||
if (Pluf::f('mercurial_repositories_unique', true)) {
|
||||
return $url;
|
||||
}
|
||||
return $url.'/'.$project->shortname;
|
||||
return sprintf(Pluf::f('mercurial_remote_url'), $project->shortname);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,10 +53,7 @@ class IDF_Scm_Mercurial
|
||||
*/
|
||||
public static function factory($project)
|
||||
{
|
||||
$rep = Pluf::f('mercurial_repositories');
|
||||
if (false == Pluf::f('mercurial_repositories_unique', false)) {
|
||||
$rep = $rep.'/'.$project->shortname;
|
||||
}
|
||||
$rep = sprintf(Pluf::f('mercurial_repositories'), $project->shortname);
|
||||
return new IDF_Scm_Mercurial($rep);
|
||||
}
|
||||
|
||||
|
@@ -55,11 +55,7 @@ class IDF_Scm_Svn
|
||||
// Remote repository
|
||||
return $url;
|
||||
}
|
||||
$url = Pluf::f('svn_remote_url');
|
||||
if (Pluf::f('svn_repositories_unique', true)) {
|
||||
return $url;
|
||||
}
|
||||
return $url.'/'.$project->shortname;
|
||||
return sprintf(Pluf::f('svn_remote_url'), $project->shortname);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,10 +75,7 @@ class IDF_Scm_Svn
|
||||
$conf->getVal('svn_username'),
|
||||
$conf->getVal('svn_password'));
|
||||
} else {
|
||||
$rep = Pluf::f('svn_repositories');
|
||||
if (false == Pluf::f('svn_repositories_unique', false)) {
|
||||
$rep = $rep.'/'.$project->shortname;
|
||||
}
|
||||
$rep = sprintf(Pluf::f('svn_repositories'), $project->shortname);
|
||||
return new IDF_Scm_Svn($rep);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user