From d8c189c8fe325189ea664c5bbf43dcd651d8c6bc Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 6 Jan 2009 23:23:59 -0700 Subject: [PATCH] Chora fixes from CVS HEAD. --- chora/annotate.php | 22 +++++++------------ chora/diff.php | 2 +- chora/templates/annotate/footer.inc | 42 ------------------------------------- chora/templates/annotate/header.inc | 1 - chora/templates/annotate/line.inc | 20 +++++++++++++----- chora/templates/diff/hr/header.inc | 6 +++--- chora/templates/directory/file.inc | 8 +++---- chora/templates/log/rev.inc | 2 +- chora/themes/screen.css | 2 ++ 9 files changed, 33 insertions(+), 72 deletions(-) delete mode 100644 chora/templates/annotate/footer.inc diff --git a/chora/annotate.php b/chora/annotate.php index 9f76e0a27..27ca66689 100644 --- a/chora/annotate.php +++ b/chora/annotate.php @@ -39,9 +39,6 @@ $revMap = $fl->revs; sort($revMap); $rrevMap = array_flip($revMap); -/* Keep track of any revision we encounter in the following loop. */ -$revList = array(); - require CHORA_TEMPLATES . '/common-header.inc'; require CHORA_TEMPLATES . '/menu.inc'; require CHORA_TEMPLATES . '/headerbar.inc'; @@ -49,25 +46,20 @@ require CHORA_TEMPLATES . '/annotate/header.inc'; /* Use this counter so that we can give each tooltip object a unique * id attribute (which we use to set the tooltip text later). */ -foreach ($lines as $line) { +while (list(,$line) = each($lines)) { $lineno = $line['lineno']; - $prevAuthor = $author; $author = Chora::showAuthorName($line['author']); - if ($prevAuthor != $author) { - $style = (++$style % 2); - } + $prevRev = $rev; $rev = $line['rev']; - $prev = isset($revMap[$rrevMap[$rev] - 1]) ? $revMap[$rrevMap[$rev] - 1] : null; - if (!isset($revList[$rev])) { - $revList[$rev] = $fl->logs[$rev]; - } - if (!is_null($prev) && !isset($revList[$prev])) { - $revList[$prev] = $fl->logs[$prev]; + if ($prevRev != $rev) { + $style = (++$style % 2); } + $prev = (isset($rrevMap[$rev]) && isset($revMap[$rrevMap[$rev] - 1])) + ? $revMap[$rrevMap[$rev] - 1] + : null; $line = Text::htmlAllSpaces($line['line']); include CHORA_TEMPLATES . '/annotate/line.inc'; ++$i; } -require CHORA_TEMPLATES . '/annotate/footer.inc'; require $registry->get('templates', 'horde') . '/common-footer.inc'; diff --git a/chora/diff.php b/chora/diff.php index 91ec2391f..8fcc55cbe 100644 --- a/chora/diff.php +++ b/chora/diff.php @@ -13,8 +13,8 @@ require_once dirname(__FILE__) . '/lib/base.php'; /* Spawn the repository and file objects */ $fl = $VC->getFileObject($where, $cache); -$rev_ob = $VC->getRevisionObject(); Chora::checkError($fl); +$rev_ob = $VC->getRevisionObject(); /* Initialise the form variables correctly. */ $r1 = Util::getFormData('r1'); diff --git a/chora/templates/annotate/footer.inc b/chora/templates/annotate/footer.inc deleted file mode 100644 index db7876d39..000000000 --- a/chora/templates/annotate/footer.inc +++ /dev/null @@ -1,42 +0,0 @@ - - - diff --git a/chora/templates/annotate/header.inc b/chora/templates/annotate/header.inc index 9036d2c4a..626de4866 100644 --- a/chora/templates/annotate/header.inc +++ b/chora/templates/annotate/header.inc @@ -4,7 +4,6 @@ - diff --git a/chora/templates/annotate/line.inc b/chora/templates/annotate/line.inc index d6da97b9e..a7d671856 100644 --- a/chora/templates/annotate/line.inc +++ b/chora/templates/annotate/line.inc @@ -1,7 +1,17 @@ - - - abbrev($rev) ?> - abbrev($prev) ?>  - + + + + + + + + abbrev($rev)) ?> + + "> + + + + + diff --git a/chora/templates/diff/hr/header.inc b/chora/templates/diff/hr/header.inc index f64c6f8d8..6360fc27c 100644 --- a/chora/templates/diff/hr/header.inc +++ b/chora/templates/diff/hr/header.inc @@ -45,7 +45,7 @@
  • - abbrev($val['rev']) ?>: + abbrev($val['rev'])) ?>:
    @@ -53,8 +53,8 @@ - - + + diff --git a/chora/templates/directory/file.inc b/chora/templates/directory/file.inc index 3ab7c28dd..67452b9ec 100644 --- a/chora/templates/directory/file.inc +++ b/chora/templates/directory/file.inc @@ -16,11 +16,11 @@ - + - + -abbrev($head) ?> +abbrev($head)) ?> @@ -31,7 +31,7 @@ - abbrev($head) ?> + abbrev($head)) ?> diff --git a/chora/templates/log/rev.inc b/chora/templates/log/rev.inc index 3d013c057..855377f7f 100644 --- a/chora/templates/log/rev.inc +++ b/chora/templates/log/rev.inc @@ -5,7 +5,7 @@ " onclick="revlog_sdiff(this);"> - abbrev($rev) . ''; if ($branchName) echo ' ' . Horde::link(Chora::url('', $where, array('onb' => $branchRev))) . htmlspecialchars($branchName) . ''; if (!empty($lg->lines)) echo ' (' . sprintf('%s lines', $lg->lines) . ')'; ?> + abbrev($rev)) . ''; if ($branchName) echo ' ' . Horde::link(Chora::url('', $where, array('onb' => $branchRev))) . htmlspecialchars($branchName) . ''; if (!empty($lg->lines)) echo ' (' . sprintf('%s lines', $lg->lines) . ')'; ?> diff --git a/chora/themes/screen.css b/chora/themes/screen.css index c134f5202..d0dfbd68b 100644 --- a/chora/themes/screen.css +++ b/chora/themes/screen.css @@ -221,6 +221,8 @@ table.annotate .author { } table.annotate .rev { background: #fee; + padding-right: 2px; + white-space: nowrap; } /* Diff styles. */ -- 2.11.0