<?
/*
 * $Horde: chora/annotate.php,v 1.5 2001/02/27 07:05:59 avsm Exp $
 *
 * Copyright 2000, 2001 Anil Madhavapeddy <anil@recoil.org>
 *
 * See the enclosed file COPYING for license information (GPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
 */

	$phpgw_info["flags"] = array(
		"currentapp" => "chora",
		"enable_nextmatchs_class" => True
	);

	include("../header.inc.php");
	$phpgw->common->crypto = "";

	require_once dirname(__FILE__).'/common.php';

	/* Spawn the file object */

	$fl = new CVSLib_File($CVS, $CVS->cvsRoot().'/'.$where);
	checkError($fl->getBrowseInfo());

	if (!isset($rev)) $rev='1.1';
	if (!CVSLib_Rev::valid($rev)) {
		//fatal('404 Not Found',"Revision $rev not found");
		echo "Revision $rev not found";
		$phpgw->common->phpgw_footer();
		$phpgw->common->exit();
	}

	$ann = new CVSLib_Annotate($CVS, $fl);
	checkError($lines = $ann->doAnnotate($rev));

	$title = "CVS Annotation of $where for version $rev";
	include($conf['paths']['templates'].'/page_header.inc');
	include($conf['paths']['templates'].'/annotate_header.inc');

	foreach ($lines as $line) {
		$author = showAuthorName($line['author']);
		$rev = $line['rev'];
		$line = htmlspecialchars($line['line']);
		include($conf['paths']['templates'].'/annotate_line.inc');
	}

	include($conf['paths']['templates'].'/annotate_footer.inc');
	//include($conf['paths']['templates'].'/page_footer.inc');
	$phpgw->common->phpgw_footer();
?>
