Fixed the case of accessing the log of an unavailable project

This commit is contained in:
Loic d'Anterroches 2009-06-26 20:52:56 +02:00
parent 16ce0da5f9
commit c366124917

View File

@ -65,6 +65,11 @@ class IDF_Views_Source
$title = sprintf(__('%1$s %2$s Change Log'), (string) $request->project, $title = sprintf(__('%1$s %2$s Change Log'), (string) $request->project,
$this->getScmType($request)); $this->getScmType($request));
$scm = IDF_Scm::get($request->project); $scm = IDF_Scm::get($request->project);
if (!$scm->isAvailable()) {
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::help',
array($request->project->shortname));
return new Pluf_HTTP_Response_Redirect($url);
}
$branches = $scm->getBranches(); $branches = $scm->getBranches();
$commit = $match[2]; $commit = $match[2];
if (!$scm->isValidRevision($commit)) { if (!$scm->isValidRevision($commit)) {