From c113c11da5358046be951ab695c62d0576eda880 Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Fri, 7 Nov 2008 14:32:22 +0100 Subject: [PATCH] Added the display of the author of a commit in the source tree. --- src/IDF/Scm/Git.php | 2 ++ src/IDF/Scm/Svn.php | 3 +-- src/IDF/templates/source/git/tree.html | 2 +- src/IDF/templates/source/svn/tree.html | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/IDF/Scm/Git.php b/src/IDF/Scm/Git.php index 6e2451a..f072a71 100644 --- a/src/IDF/Scm/Git.php +++ b/src/IDF/Scm/Git.php @@ -134,9 +134,11 @@ class IDF_Scm_Git $fc = $this->getCommit($matches[1]); $file->date = $fc->date; $file->log = $fc->title; + $file->author = $fc->author; } else if ($file->type == 'blob') { $file->date = $co->date; $file->log = $co->title; + $file->author = $co->author; // May be wrong in some cases. } $file->fullpath = ($folder) ? $folder.'/'.$file->file : $file->file; $res[] = $file; diff --git a/src/IDF/Scm/Svn.php b/src/IDF/Scm/Svn.php index 4197602..0b5f561 100644 --- a/src/IDF/Scm/Svn.php +++ b/src/IDF/Scm/Svn.php @@ -161,9 +161,8 @@ class IDF_Scm_Svn if ($file['type'] == 'blob') { $file['size'] = (string) $entry->size; } - + $file['author'] = $entry->commit->author; $file['perm'] = ''; - $res[] = (object) $file; } diff --git a/src/IDF/templates/source/git/tree.html b/src/IDF/templates/source/git/tree.html index f1235da..9db8cae 100644 --- a/src/IDF/templates/source/git/tree.html +++ b/src/IDF/templates/source/git/tree.html @@ -35,7 +35,7 @@ {if $file.type == 'blob'} {if isset($file.date)} {$file.date|dateago:"wihtout"} -{$file.log} +{$file.author|strip_tags|trim}{trans ':'} {$file.log} {else}{/if} {$file.size|size}{/if} diff --git a/src/IDF/templates/source/svn/tree.html b/src/IDF/templates/source/svn/tree.html index e1b39fc..e0016d1 100644 --- a/src/IDF/templates/source/svn/tree.html +++ b/src/IDF/templates/source/svn/tree.html @@ -47,7 +47,7 @@ {$file.file} {$file.date|dateago:"wihtout"} {$file.rev} - {$file.log|nl2br} + {$file.author|strip_tags|trim}{trans ':'} {$file.log|nl2br} {if $file.type == 'blob'} {$file.size|size} {/if}