From 3e238bea0b723cf74e6d688bcf6dfbb3ddb0c2ab Mon Sep 17 00:00:00 2001 From: William MARTIN Date: Wed, 23 Feb 2011 18:12:29 +0100 Subject: [PATCH] Enhancement of the invalid revision handler Show the list of available branch --- src/IDF/Views/Source.php | 4 ++++ src/IDF/templates/idf/source/invalid_revision.html | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index 472d710..f92a2d5 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -56,11 +56,15 @@ class IDF_Views_Source public function invalidRevision($request, $match) { $title = sprintf(__('%s Invalid Revision'), (string) $request->project); + $scm = IDF_Scm::get($request->project); + $branches = $scm->getBranches(); + $commit = $match[2]; $params = array( 'page_title' => $title, 'title' => $title, 'commit' => $commit, + 'branches' => $branches, ); return Pluf_Shortcuts_RenderToResponse('idf/source/invalid_revision.html', $params, $request); diff --git a/src/IDF/templates/idf/source/invalid_revision.html b/src/IDF/templates/idf/source/invalid_revision.html index 4c0e966..c253a35 100644 --- a/src/IDF/templates/idf/source/invalid_revision.html +++ b/src/IDF/templates/idf/source/invalid_revision.html @@ -5,6 +5,16 @@

{blocktrans}The revision {$commit} is not valid or does not exist in this repository.{/blocktrans}

+

{blocktrans}List of available branch are listed below :{/blocktrans}

+ + {if $isOwner or $isMember} {aurl 'url', 'IDF_Views_Source::help', array($project.shortname)}

{blocktrans}If this is a new repository, the reason for this error