exit;
}
-$onb = Horde_Util::getFormData('onb');
+$onb = Horde_Util::getFormData('onb', $VC->getDefaultBranch());
try {
$fl = $VC->getFileObject($where, array('branch' => $onb));
} catch (Horde_Vcs_Exception $e) {
}
}
-Horde::addScriptFile('tables.js', 'horde');
-Horde::addScriptFile('quickfinder.js', 'horde');
Horde::addScriptFile('revlog.js', 'chora');
require $registry->get('templates', 'horde') . '/common-header.inc';
require CHORA_TEMPLATES . '/menu.inc';
require CHORA_TEMPLATES . '/headerbar.inc';
require CHORA_TEMPLATES . '/log/header.inc';
-$i = 0;
-$diff_img = Horde::img('diff.png');
reset($logs);
-while (list(,$lg) = each($logs)) {
- $rev = $lg->queryRevision();
- $branch_info = $lg->queryBranch();
-
- $added = $deleted = null;
- $fileinfo = $lg->queryFiles($where);
- if ($fileinfo && isset($fileinfo['added'])) {
- $added = $fileinfo['added'];
- $deleted = $fileinfo['deleted'];
- }
-
- // TODO: Remove in favor of getting info from queryFiles()
- $changedlines = $lg->queryChangedLines();
-
- $textUrl = Chora::url('co', $where, array('r' => $rev));
- $commitDate = Chora::formatDate($lg->queryDate());
- $readableDate = Chora::readableTime($lg->queryDate(), true);
-
- $author = Chora::showAuthorName($lg->queryAuthor(), true);
- $tags = Chora::getTags($lg, $where);
-
- if ($prevRevision = $fl->queryPreviousRevision($lg->queryRevision())) {
- $diffUrl = Chora::url('diff', $where, array('r1' => $prevRevision, 'r2' => $rev));
- } else {
- $diffUrl = '';
- }
-
- $logMessage = Chora::formatLogMessage($lg->queryLog());
-
- require CHORA_TEMPLATES . '/log/rev.inc';
-
- if (($i++ > 100) && !Horde_Util::getFormData('all')) {
- break;
+$view = $injector->createInstance('Horde_View');
+$currentDay = null;
+echo '<div class="commit-list">';
+foreach ($logs as $log) {
+ $day = date('Y-m-d', $log->queryDate());
+ if ($day != $currentDay) {
+ echo '<h3>' . $day . '</h3>';
+ $currentDay = $day;
}
+ echo $view->renderPartial('app/views/logMessage', array('object' => $log));
}
-require CHORA_TEMPLATES . '/log/footer.inc';
+echo '</div>';
require $registry->get('templates', 'horde') . '/common-footer.inc';
highlight: function()
{
- $('revlog_body').select('TR').each(function(tr) {
- if (Prototype.Browser.IE) {
- tr.observe('mouseover', this.rowover.bindAsEventListener(this, 'over'));
- tr.observe('mouseover', this.rowover.bindAsEventListener(this, 'out'));
- }
- tr.observe('click', this.toggle.bindAsEventListener(this));
- }, this);
+ revlog_body = $('revlog_body');
+ if (revlog_body) {
+ revlog_body.select('TR').each(function(tr) {
+ if (Prototype.Browser.IE) {
+ tr.observe('mouseover', this.rowover.bindAsEventListener(this, 'over'));
+ tr.observe('mouseover', this.rowover.bindAsEventListener(this, 'out'));
+ }
+ tr.observe('click', this.toggle.bindAsEventListener(this));
+ }, this);
+ }
},
rowover: function(e, type)
+++ /dev/null
-</tbody>
-</table>
-
-<?php if ($fl->revisionCount() > 100 && !Horde_Util::getFormData('all')): ?>
-<div class="options">
- <span>
- <?php printf(_("Only showing the 100 latest revisions. %sShow all revisions?</a> (may take a while)."), Horde::link(Horde_Util::addParameter(Horde::selfUrl(true), 'all', 1))) ?>
- </span>
-</div>
-<?php endif ?>
<div class="browsefileoptions">
- <div>
- <?php echo _("Search Revisions:") ?>
- <input type="text" for="revlog_body" size="20" />
- </div>
-
+<!--
<div>
<?php if (!$browser->hasFeature('javascript')): ?>
<form method="get" action="diff.php">
<?php endif; ?>
<em><?php printf(_("%1\$s shows diffs to the previous revision. If you select a revision by clicking its row, %1\$s will show the differences to the selected row."), Horde::img('diff.png', _("Show Differences"))) ?></em>
</div>
+-->
<?php if (!empty($selAllBranches)): ?>
<div>
<form method="get" action="<?php echo Chora::url('browsefile', Horde_Util::getFormData('f')) ?>">
<?php echo _("Show Branch:") ?>
<select name="onb" onchange="this.form.submit()">
- <option value="0"<?php if (!isset($onb) || !$onb) echo ' selected="selected"' ?>><?php echo _("All Branches") ?></option>
<?php echo $selAllBranches ?>
</select>
<noscript><input class="button" type="submit" value="<?php echo _("View") ?>" /></noscript>
</div>
<?php endif; ?>
</div>
-
-<table class="revlog striped sortable" id="revlog" cellspacing="0">
-<thead>
- <tr class="item leftAlign">
- <th class="nosort"> </th>
- <th><?php echo _("Revision") ?></th>
- <th class="sortup"><?php echo _("Date") ?></th>
- <th><?php echo _("Author") ?></th>
- <th class="nosort"><?php echo _("Log Message") ?></th>
- </tr>
-</thead>
-<tbody id="revlog_body">
+++ /dev/null
-<tr id="rev<?php echo $rev ?>">
- <td>
- <?php if ($diffUrl): ?>
- <a href="<?php echo $diffUrl ?>" class="pdiff" title="<?php echo _("Show changes to the previous revision") ?>"><?php echo $diff_img ?></a>
- <?php endif ?>
- <a href="<?php echo Chora::url('diff', $where, array('r1' => 0, 'r2' => $rev)) ?>" class="sdiff" title="<?php echo _("Show changes to the selected revision") ?>" onclick="Chora_RevLog.sdiff(this);"><?php echo $diff_img ?></a>
- </td>
- <td><a href="<?php echo $textUrl ?>" title="<?php echo htmlspecialchars($rev) ?>"><?php echo htmlspecialchars($VC->abbrev($rev)) ?></a>
-<?php $branchlist = array_diff($branch_info, array($onb)); if (!empty($branchlist)): ?>
- <span class="branch">
-<?php foreach ($branchlist as $val): ?>
- <?php echo Chora::url('browsefile', $where, array('onb' => $val))->link() . htmlspecialchars($val) ?></a>
-<?php endforeach; ?>
- </span>
-<?php endif; ?>
-<?php if (!empty($changedlines)): ?>
- <small class="difflines">(<?php printf('%s lines', htmlspecialchars($changedlines)) ?>)</small>
-<?php elseif (!is_null($added)): ?>
- <small class="difflines">(<span class="diffadd">+<?php echo $added ?></span>, <span class="diffdel">-<?php echo $deleted ?></span> <?php echo _("lines") ?>)</small>
-<?php endif; ?>
- </td>
- <td class="ago" sortval="<?php echo (int)$lg->queryDate() ?>"><a title="<?php echo $readableDate ?>"><?php echo $commitDate ?></a></td>
- <td class="author"><?php echo $author ?></td>
- <td class="log">
- <p class="message"><?php echo $logMessage ?></p>
-<?php if ($tags): ?>
- <p class="tags"><?php echo _("Tags") . ': ' . implode(', ', $tags) ?></p>
-<?php endif; ?>
- </td>
-</tr>
{
$log_list = null;
+ if (empty($this->_branch)) { $this->_branch = $this->_rep->getDefaultBranch(); }
+
/* First, grab the master list of revisions. If quicklog is specified,
* we don't need this master list - we are only concerned about the
* most recent revision for the given branch. */
if ($this->_quicklog) {
- $branchlist = empty($this->_branch)
- ? array($this->_rep->getDefaultBranch())
- : array($this->_branch);
+ $branchlist = array($this->_branch);
} else {
if (version_compare($this->_rep->version, '1.6.0', '>=')) {
$cmd = $this->_rep->getCommand() . ' rev-list --branches -- ' . escapeshellarg($this->queryModulePath()) . ' 2>&1';
$branchlist = array_keys($this->queryBranches());
}
- /* Get the list of revisions. Need to get all revisions, not just
- * those on $this->_branch, for branch determination reasons. */
- foreach ($branchlist as $key) {
- $revs = array();
- $cmd = $this->_rep->getCommand() . ' rev-list ' . ($this->_quicklog ? '-n 1' : '') . ' ' . escapeshellarg($key) . ' -- ' . escapeshellarg($this->queryModulePath()) . ' 2>&1';
- exec($cmd, $revs);
+ $revs = array();
+ $cmd = $this->_rep->getCommand() . ' rev-list' . ($this->_quicklog ? ' -n 1' : '') . ' ' . escapeshellarg($this->_branch) . ' -- ' . escapeshellarg($this->queryModulePath()) . ' 2>&1';
+ exec($cmd, $revs);
- if (!empty($revs)) {
- if (stripos($revs[0], 'fatal') === 0) {
- throw new Horde_Vcs_Exception(implode(', ', $revs));
- }
+ if (!empty($revs)) {
+ if (stripos($revs[0], 'fatal') === 0) {
+ throw new Horde_Vcs_Exception(implode(', ', $revs));
+ }
- $this->_revlist[$key] = $revs;
+ $this->_revlist[$this->_branch] = $revs;
- if (!empty($this->_branch) && ($this->_branch == $key)) {
- $log_list = $revs;
- }
+ $log_list = $revs;
- if ($this->_quicklog) {
- $this->_revs[] = reset($revs);
- }
+ if ($this->_quicklog) {
+ $this->_revs[] = reset($revs);
}
}