From 97bc383bc03e4f2ca8a1626aa6af1fe5e4d114fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20d=27Anterroches?= Date: Thu, 23 Dec 2010 11:57:39 +0100 Subject: [PATCH] Updated to display changes only if the backend supports this function. --- src/IDF/Views/Source.php | 7 ++++++- src/IDF/templates/idf/source/commit.html | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index 6652d66..00b7a69 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -299,8 +299,13 @@ class IDF_Views_Source $rcommit = IDF_Commit::getOrAdd($cobject, $request->project); $diff = new IDF_Diff($cobject->diff); $diff->parse(); - $changes = $scm->getChanges($commit); $scmConf = $request->conf->getVal('scm', 'git'); + try { + $changes = $scm->getChanges($commit); + } catch (Exception $e) { + // getChanges is not yes supported by this backend. + $changes = array(); + } $branches = $scm->getBranches(); $in_branches = $scm->inBranches($cobject->commit, ''); $tags = $scm->getTags(); diff --git a/src/IDF/templates/idf/source/commit.html b/src/IDF/templates/idf/source/commit.html index e918fee..18b822f 100644 --- a/src/IDF/templates/idf/source/commit.html +++ b/src/IDF/templates/idf/source/commit.html @@ -17,7 +17,7 @@ {trans 'Message:'}{issuetext $cobject.title, $request}{if isset($cobject.full_message)}

{issuetext $cobject.full_message, $request, true, false, true, true, true}{/if} - +{if count($changes)} {trans 'Changes:'} @@ -52,7 +52,7 @@ {/foreach} - +{/if} {* End of the if count($changes) *} {if count($diff.files)}