Cleaned the code to have consistent style.
This commit is contained in:
parent
b881ad1c8f
commit
2b5f97b362
@ -35,29 +35,24 @@ class IDF_Views_Source_Svn
|
|||||||
public function treeRev($request, $match)
|
public function treeRev($request, $match)
|
||||||
{
|
{
|
||||||
$prj = $request->project;
|
$prj = $request->project;
|
||||||
|
|
||||||
// Redirect to tree base if not svn
|
|
||||||
if ($request->conf->getVal('scm', 'git') != 'svn') {
|
if ($request->conf->getVal('scm', 'git') != 'svn') {
|
||||||
|
// Redirect to tree base if not svn
|
||||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
|
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
|
||||||
array($prj->shortname, $prj->getScmRoot()));
|
array($prj->shortname, $prj->getScmRoot()));
|
||||||
|
|
||||||
return new Pluf_HTTP_Response_Redirect($url);
|
return new Pluf_HTTP_Response_Redirect($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get revision value
|
// Get revision value
|
||||||
if (!isset($request->REQUEST['rev']) or trim($request->REQUEST['rev']) == '') {
|
if (!isset($request->REQUEST['rev'])
|
||||||
|
or trim($request->REQUEST['rev']) == '') {
|
||||||
$scmRoot = $prj->getScmRoot();
|
$scmRoot = $prj->getScmRoot();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$scmRoot = $request->REQUEST['rev'];
|
$scmRoot = $request->REQUEST['rev'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get source if not /
|
// Get source if not /
|
||||||
if (isset($request->REQUEST['sourcefile']) and trim($request->REQUEST['sourcefile']) != '') {
|
if (isset($request->REQUEST['sourcefile'])
|
||||||
|
and trim($request->REQUEST['sourcefile']) != '') {
|
||||||
$scmRoot .= '/'.$request->REQUEST['sourcefile'];
|
$scmRoot .= '/'.$request->REQUEST['sourcefile'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect
|
|
||||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
|
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
|
||||||
array($prj->shortname, $scmRoot));
|
array($prj->shortname, $scmRoot));
|
||||||
return new Pluf_HTTP_Response_Redirect($url);
|
return new Pluf_HTTP_Response_Redirect($url);
|
||||||
@ -70,22 +65,18 @@ class IDF_Views_Source_Svn
|
|||||||
public function changelogRev($request, $match)
|
public function changelogRev($request, $match)
|
||||||
{
|
{
|
||||||
$prj = $request->project;
|
$prj = $request->project;
|
||||||
|
|
||||||
// Redirect to tree base if not svn
|
|
||||||
if ($request->conf->getVal('scm', 'git') != 'svn') {
|
if ($request->conf->getVal('scm', 'git') != 'svn') {
|
||||||
|
// Redirect to tree base if not svn
|
||||||
$scmRoot = $prj->getScmRoot();
|
$scmRoot = $prj->getScmRoot();
|
||||||
}
|
} else {
|
||||||
// Get revision value if svn
|
// Get revision value if svn
|
||||||
else {
|
if (!isset($request->REQUEST['rev'])
|
||||||
if (!isset($request->REQUEST['rev']) or trim($request->REQUEST['rev']) == '') {
|
or trim($request->REQUEST['rev']) == '') {
|
||||||
$scmRoot = $prj->getScmRoot();
|
$scmRoot = $prj->getScmRoot();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$scmRoot = $request->REQUEST['rev'];
|
$scmRoot = $request->REQUEST['rev'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect
|
|
||||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::changeLog',
|
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::changeLog',
|
||||||
array($prj->shortname, $scmRoot));
|
array($prj->shortname, $scmRoot));
|
||||||
return new Pluf_HTTP_Response_Redirect($url);
|
return new Pluf_HTTP_Response_Redirect($url);
|
||||||
|
Loading…
Reference in New Issue
Block a user