-
Notifications
You must be signed in to change notification settings - Fork 2
/
patchsets.php
67 lines (56 loc) · 1.96 KB
/
patchsets.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* Patchsets script.
*
* Copyright 1999-2017 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Anil Madhavapeddy <[email protected]>
* @author Chuck Hagenbuch <[email protected]>
* @author Michael Slusarz <[email protected]>
* @package Chora
*/
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('chora');
// Exit if patchset feature is not available.
if (!$GLOBALS['VC']->hasFeature('patchsets')) {
Chora::url('browsefile', $where)->redirect();
}
$ps_opts = array('timezone' => $prefs->getValue('timezone'));
if ($where) {
$ps_opts['file'] = $where;
if (!isset($title)) {
$title = _("Commits to:");
}
}
try {
$ps = $VC->getPatchset($ps_opts);
$patchsets = $ps->getPatchsets();
} catch (Horde_Vcs_Exception $e) {
Chora::fatal($e);
}
if (empty($patchsets)) {
Chora::fatal(_("Commit Not Found"), '404 Not Found');
}
$page_output->addScriptFile('tables.js', 'horde');
$page_output->addScriptFile('quickfinder.js', 'horde');
Chora::header($title);
echo Chora::getHistoryViews($where)->render('patchsets');
require CHORA_TEMPLATES . '/patchsets/header_table.inc';
$diff_img = Horde::img('diff.png', _("Diff"));
reset($patchsets);
while (list($id, $patchset) = each($patchsets)) {
$patchset_link = Chora::url('commit', $where, array('commit' => $id))
->link(array('title' => $id))
. htmlspecialchars($VC->abbrev($id)) . '</a>';
$commitDate = Chora::formatDate($patchset['date']);
$readableDate = Chora::readableTime($patchset['date'], true);
$author = Chora::showAuthorName($patchset['author'], true);
$logMessage = Chora::formatLogMessage($patchset['log']);
$tags = array_merge($patchset['branch'], $patchset['tags']);
require CHORA_TEMPLATES . '/patchsets/ps.inc';
}
require CHORA_TEMPLATES . '/patchsets/footer.inc';
$page_output->footer();