From 01d7434ca9177a8d6d40b8f76e8393f6d5b3e4ae Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 22 Dec 2008 23:29:25 -0700 Subject: [PATCH] Fix call to Horde_Vcs_Revision; nits. --- chora/annotate.php | 12 ++++++------ chora/browse.php | 15 +++++++-------- chora/lib/Chora.php | 5 +++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/chora/annotate.php b/chora/annotate.php index 8b4cd5c13..f7c65009d 100644 --- a/chora/annotate.php +++ b/chora/annotate.php @@ -29,13 +29,9 @@ $title = sprintf(_("Source Annotation of %s (revision %s)"), Text::htmlAllSpaces $extraLink = sprintf('%s | %s', Chora::url('co', $where, array('r' => $rev)), _("View"), Chora::url('co', $where, array('r' => $rev, 'p' => 1)), _("Download")); -require CHORA_TEMPLATES . '/common-header.inc'; -require CHORA_TEMPLATES . '/menu.inc'; -require CHORA_TEMPLATES . '/headerbar.inc'; -require CHORA_TEMPLATES . '/annotate/header.inc'; $author = ''; -$style = 0; +$i = $style = 0; /* Map of revisions for finding the previous revision to a change. */ $revMap = $fl->revs; @@ -45,9 +41,13 @@ $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'; +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). */ -$i = 0; foreach ($lines as $line) { $lineno = $line['lineno']; $prevAuthor = $author; diff --git a/chora/browse.php b/chora/browse.php index b097df790..4e67d20c8 100644 --- a/chora/browse.php +++ b/chora/browse.php @@ -26,11 +26,9 @@ if ($atdir) { Chora::checkError($fileList = $dir->queryFileList($atticFlags)); /* Decide what title to display. */ - if ($where == '') { - $title = $conf['options']['introTitle']; - } else { - $title = sprintf(_("Source Directory of /%s"), $where); - } + $title = ($where == '') + ? $conf['options']['introTitle'] + : sprintf(_("Source Directory of /%s"), $where); $extraLink = ''; if (is_a($VC, 'VC_cvs')) { @@ -132,16 +130,17 @@ if ($atdir) { /* Showing a file. */ $fl = $VC->getFileObject($where, $cache); +$rev_ob = $VC->getRevisionObject(); Chora::checkError($fl); $title = sprintf(_("Revisions for %s"), $where); $onb = Util::getFormData('onb', 0); if ($VC->isValidRevision($onb)) { $onb_len = strlen($onb); - $onb_base = Horde_Vcs_Revision::strip($onb, 1); + $onb_base = $rev_ob->strip($onb, 1); $onb_parents = array(); while (substr_count($onb_base, '.')) { $onb_parents[$onb_base] = true; - $onb_base = Horde_Vcs_Revision::strip($onb_base, 1); + $onb_base = $rev_ob->strip($onb_base, 1); } } else { $onb = null; @@ -183,7 +182,7 @@ foreach ($fl->logs as $lg) { /* If the revision is on one of the parent branches, and * is before the branch was made, let it through. */ if ((!isset($onb_parents[$branchRev]) && substr_count($rev, '.') > 1) || - Horde_Vcs_Revision::cmp($rev, $onb) > 0) { + $rev_ob->cmp($rev, $onb) > 0) { continue; } } diff --git a/chora/lib/Chora.php b/chora/lib/Chora.php index 087a27d01..454702dd5 100644 --- a/chora/lib/Chora.php +++ b/chora/lib/Chora.php @@ -565,14 +565,15 @@ class Chora { * Return branch information for a given revision. * * @param Horde_Vcs_File $fl The Horde_Vcs_File object. - * @param string $rev The filename. + * @param string $rev The filename. * * @return array An 2-member array - branch name and branch revision. */ function getBranch($fl, $rev) { $branchName = ''; - $branchRev = Horde_Vcs_Revision::strip($rev, 1); + $rev_ob = $fl->rev->getRevisionObject(); + $branchRev = $rev_ob->strip($rev, 1); if (isset($fl->branches[$rev])) { $branchName = $fl->branches[$rev]; } elseif (isset($fl->branches[$branchRev])) { -- 2.11.0