Add basic framework for web based repository access

/p/$project/source/repo/ is assigned to a method that
takes care of providing repository access.
For now, this results in an exception on all SCMs.
This commit is contained in:
Patrick Georgi 2011-08-19 22:01:55 +02:00
parent a2c832a130
commit aa2868eb17
3 changed files with 16 additions and 0 deletions

View File

@ -497,5 +497,10 @@ class IDF_Scm
{ {
return 0; return 0;
} }
public function repository($request, $match)
{
throw new Exception('This repository does not support web based repository access');
}
} }

View File

@ -132,6 +132,12 @@ class IDF_Views_Source
$request); $request);
} }
public function repository($request, $match)
{
$scm = IDF_Scm::get($request->project);
return $scm->repository($request, $match);
}
public $treeBase_precond = array('IDF_Precondition::accessSource', public $treeBase_precond = array('IDF_Precondition::accessSource',
'IDF_Views_Source_Precondition::scmAvailable', 'IDF_Views_Source_Precondition::scmAvailable',
'IDF_Views_Source_Precondition::revisionValid'); 'IDF_Views_Source_Precondition::revisionValid');

View File

@ -245,6 +245,11 @@ $ctl[] = array('regex' => '#^/p/([\-\w]+)/source/changesrev/$#',
'model' => 'IDF_Views_Source_Svn', 'model' => 'IDF_Views_Source_Svn',
'method' => 'changelogRev'); 'method' => 'changelogRev');
$ctl[] = array('regex' => '#^/p/([\-\w]+)/source/repo/(.*)$#',
'base' => $base,
'model' => 'IDF_Views_Source',
'method' => 'repository');
// ---------- WIKI ----------------------------------------- // ---------- WIKI -----------------------------------------
$ctl[] = array('regex' => '#^/p/([\-\w]+)/doc/$#', $ctl[] = array('regex' => '#^/p/([\-\w]+)/doc/$#',