$extraLink = sprintf('<a href="%s">%s</a> | <a href="%s">%s</a>',
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;
/* 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;
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')) {
/* 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;
/* 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;
}
}
* 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])) {