From aa2868eb17e776371b342184b4f552a40518138a Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 19 Aug 2011 22:01:55 +0200 Subject: [PATCH] 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. --- src/IDF/Scm.php | 5 +++++ src/IDF/Views/Source.php | 6 ++++++ src/IDF/conf/urls.php | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/src/IDF/Scm.php b/src/IDF/Scm.php index 5ebb8d9..350b073 100644 --- a/src/IDF/Scm.php +++ b/src/IDF/Scm.php @@ -497,5 +497,10 @@ class IDF_Scm { return 0; } + + public function repository($request, $match) + { + throw new Exception('This repository does not support web based repository access'); + } } diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index 1496e54..1a556a0 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -132,6 +132,12 @@ class IDF_Views_Source $request); } + public function repository($request, $match) + { + $scm = IDF_Scm::get($request->project); + return $scm->repository($request, $match); + } + public $treeBase_precond = array('IDF_Precondition::accessSource', 'IDF_Views_Source_Precondition::scmAvailable', 'IDF_Views_Source_Precondition::revisionValid'); diff --git a/src/IDF/conf/urls.php b/src/IDF/conf/urls.php index 03779c0..d79c998 100644 --- a/src/IDF/conf/urls.php +++ b/src/IDF/conf/urls.php @@ -245,6 +245,11 @@ $ctl[] = array('regex' => '#^/p/([\-\w]+)/source/changesrev/$#', 'model' => 'IDF_Views_Source_Svn', 'method' => 'changelogRev'); +$ctl[] = array('regex' => '#^/p/([\-\w]+)/source/repo/(.*)$#', + 'base' => $base, + 'model' => 'IDF_Views_Source', + 'method' => 'repository'); + // ---------- WIKI ----------------------------------------- $ctl[] = array('regex' => '#^/p/([\-\w]+)/doc/$#',