X-Git-Url: http://git.pk910.de/?p=phpgitweb.git;a=blobdiff_plain;f=htdocs%2Fpages%2Fcommit.class.php;fp=htdocs%2Fpages%2Fcommit.class.php;h=389efaabf38acbbc7837f70a8975840bee8a37c8;hp=3c10b4486d1798bb7675eaac08b9de1863202158;hb=38cb4c7eb8706a5e500957185493e2025fde5dc1;hpb=3225d787391540a52b39a34ca809a71d443b49f0 diff --git a/htdocs/pages/commit.class.php b/htdocs/pages/commit.class.php index 3c10b44..389efaa 100644 --- a/htdocs/pages/commit.class.php +++ b/htdocs/pages/commit.class.php @@ -16,24 +16,33 @@ * along with this program. If not, see . */ -require_once('pages/shortlog.class.php'); - class difftree { + private $difftree_data = null; + + public function push_difftree_data($data) { + $this->difftree_data = $data; + } public function generate_difftree($project, $commit, $patch_link) { $difftree = new ContentProvider('commit', 'difftree'); - $tree = GitCommand::get_commit_changes($project['path'], $commit['id'], $commit['parent']); + if($this->difftree_data) + $tree = $this->difftree_data; + else + $tree = GitCommand::get_commit_changes($project['path'], $commit['id'], $commit['parent']); $entry_count = 0; if(count($commit['parent']) > 1) $difftree->set('class', ' combined'); else $difftree->set('class', ''); + $difftree->set('tree_count', ''); foreach($tree as $entry) { $entry_count++; $difftree->append('tree', $this->tree_entry($entry_count, (($entry_count % 2) ? 'dark' : 'light'), $commit, $entry, $patch_link)); } - if(count($tree) == 0) + if($entry_count == 0) $difftree->set('tree', ''); + else if($entry_count > 10) + $difftree->set('tree_count', new ContentProvider('commit', 'tree_count', array('count' => $entry_count))); return $difftree; } @@ -138,7 +147,7 @@ class difftree { } } else $tree->set('specials', ''); - if($entry['from_id'] != $entry['to_id']) + if(!$patch_link && $entry['from_id'] != $entry['to_id']) $tree->append('links', new ContentProvider('commit', 'tree_changed_links_diff', $link_placeholders)); $tree->append('links', new ContentProvider('commit', 'tree_changed_links', $link_placeholders)); break; @@ -215,7 +224,7 @@ class page_commit { else $this->page->set('committer_local_date', gmdate('H:i', $committer_local_time)); $this->page->set('committer_timezone', $commit['committer_timezone']); - $this->page->set('message', htmlentities(Tools::chop_text($commit['text'], 50, 5))); + $this->page->set('message', htmlentities(Tools::chop_text($commit['text'], 80, 5))); $this->page->set('full_message', htmlentities($commit['text'])); $this->page->set('tree_hash', $commit['tree']); foreach($commit['parent'] as $parent) {