* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-require_once('pages/shortlog.class.php');
-
class page_commit {
private $page, $phpgitweb;
- private $commitid;
public function main($phpgitweb, $project) {
$this->phpgitweb = $phpgitweb;
$project['refs'] = $phpgitweb->get_project_loader()->getProjectRefs($project);
$phpgitweb->append_header_nav("commit", null, true);
$phpgitweb->append_title("commit");
+ CommitLoader::parse();
$commit_loader = new CommitLoader($project);
-
- if(array_key_exists('h', $_GET))
- $commitid = $_GET['h'];
- else
- $commitid = "HEAD";
-
- $commit = $commit_loader->load($commitid);
+ $commit = $commit_loader->load();
if(!$commit)
return new ContentProvider('main', 'err404_object');
- ContentProvider::overall_set('project_head', $commit['id']);
+ ContentProvider::overall_set('commit_id', $commit['id']);
$this->page = new ContentProvider('commit', 'main');
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) {
$this->page->append('parents', new ContentProvider('commit', 'parent', array('hash' => $parent, 'head' => $commit['id'])));
}
+ if(count($commit['parent']) == 0)
+ $this->page->set('parents', '');
$refs = new ContentProvider('commit', 'commit_refs');
$found = false;
}
$this->page->set('refs', ($found ? $refs : ""));
+ $difftree = new difftree();
+ $this->page->set('difftree', $difftree->generate_difftree($project, $commit, false));
+
return $this->page;
}
+
+
}
?>
\ No newline at end of file