From a489cb15b5348cb5d80d3851c584c81f7a13a55d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20d=27Anterroches?= Date: Thu, 20 Jan 2011 10:25:41 +0100 Subject: [PATCH] Added the display of the merge history in a commit view. --- src/IDF/Scm/Git.php | 8 +++++++- src/IDF/templates/idf/source/commit.html | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/IDF/Scm/Git.php b/src/IDF/Scm/Git.php index edc1aab..90954b8 100644 --- a/src/IDF/Scm/Git.php +++ b/src/IDF/Scm/Git.php @@ -27,7 +27,7 @@ */ class IDF_Scm_Git extends IDF_Scm { - public $mediumtree_fmt = 'commit %H%nAuthor: %an <%ae>%nTree: %T%nDate: %ai%n%n%s%n%n%b'; + public $mediumtree_fmt = 'commit %H%nAuthor: %an <%ae>%nTree: %T%nParents: %P%nDate: %ai%n%n%s%n%n%b'; /* ============================================== * * * @@ -518,6 +518,9 @@ class IDF_Scm_Git extends IDF_Scm $c['full_message'] = trim($c['full_message']); $c['full_message'] = IDF_Commit::toUTF8($c['full_message']); $c['title'] = IDF_Commit::toUTF8($c['title']); + if (isset($c['parents'])) { + $c['parents'] = explode(' ', trim($c['parents'])); + } $res[] = (object) $c; } $c = array(); @@ -553,6 +556,9 @@ class IDF_Scm_Git extends IDF_Scm $c['full_message'] = !empty($c['full_message']) ? trim($c['full_message']) : ''; $c['full_message'] = IDF_Commit::toUTF8($c['full_message']); $c['title'] = IDF_Commit::toUTF8($c['title']); + if (isset($c['parents'])) { + $c['parents'] = explode(' ', trim($c['parents'])); + } $res[] = (object) $c; return $res; } diff --git a/src/IDF/templates/idf/source/commit.html b/src/IDF/templates/idf/source/commit.html index 18b822f..4c5814e 100644 --- a/src/IDF/templates/idf/source/commit.html +++ b/src/IDF/templates/idf/source/commit.html @@ -15,6 +15,12 @@ {trans 'Commit:'}{$cobject.commit} +{if $cobject.parents} +{trans 'Parents:'}{foreach $cobject.parents as $parent} +{$parent}
+{/foreach} + +{/if} {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)}