示例#1
0
            require CHORA_TEMPLATES . '/history/blank.inc';
            continue;
        }
        /* Otherwise, this cell has content; determine what it is */
        $rev = $row[$i];
        if (VC_Revision::valid($rev) && VC_Revision::sizeof($rev) % 2) {
            /* This is a branch point, so put the info out */
            $bg = isset($branchColours[$rev]) ? $branchColours[$rev] : 'white';
            $symname = $fl->branches[$rev];
            require CHORA_TEMPLATES . '/history/branch_cell.inc';
        } elseif (preg_match('|^:|', $rev)) {
            /* This is a continuation cell, so render it with the branch colour */
            $bgbr = VC_Revision::strip(preg_replace('|^\\:|', '', $rev), 1);
            $bg = isset($branchColours[$bgbr]) ? $branchColours[$bgbr] : 'white';
            require CHORA_TEMPLATES . '/history/blank.inc';
        } elseif (VC_Revision::valid($rev)) {
            /* This cell contains a revision, so render it */
            $bgbr = VC_Revision::strip($rev, 1);
            $bg = isset($branchColours[$bgbr]) ? $branchColours[$bgbr] : 'white';
            $log = $fl->logs[$rev];
            $author = Chora::showAuthorName($log->queryAuthor());
            $date = strftime('%e %b %Y', $log->queryDate());
            $lines = $log->queryChangedLines();
            require CHORA_TEMPLATES . '/history/rev.inc';
        } else {
            /* Exhausted other possibilities, just show a blank cell */
            require CHORA_TEMPLATES . '/history/blank.inc';
        }
    }
    require CHORA_TEMPLATES . '/history/row_end.inc';
}
示例#2
0
文件: cvs.php 项目: Artea/freebeer
 $fl =& $VC->getFileObject($where);
 $title = sprintf(_("Source Log for %s"), Text::htmlAllSpaces($where));
 $upwhere = preg_replace('|[^/]+$|', '', $where);
 $onb = Util::getFormData('onb', 0);
 $r1 = Util::getFormData('r1', 0);
 $isBranch = isset($onb) && isset($fl->branches[$onb]) ? $fl->branches[$onb] : '';
 $extraLink = Chora::getFileViews();
 require CHORA_TEMPLATES . '/common-header.inc';
 Chora::menu();
 require CHORA_TEMPLATES . '/headerbar.inc';
 $mimeType = MIME_Magic::filenameToMIME($fullname);
 $defaultTextPlain = $mimeType == 'text/plain';
 foreach ($fl->logs as $lg) {
     $rev = $lg->rev;
     /* Are we sticking only to one branch ? */
     if ($onb && VC_Revision::valid($onb)) {
         /* If so, if we are on the branch itself, let it through */
         if (substr($rev, 0, strlen($onb)) != $onb) {
             /* We are not on the branch, see if we are on a trunk
              * branch below the branch */
             $baseRev = VC_Revision::strip($onb, 1);
             /* Check we are at the same level of branching or less */
             if (substr_count($rev, '.') <= substr_count($baseRev, '.')) {
                 /* If we are at the same level, and the revision is
                  * less, then let the revision through, since it was
                  * committed before the branch actually took place
                  */
                 if (VC_Revision::cmp($rev, $baseRev) > 0) {
                     continue;
                 }
             } else {
示例#3
0
/**
 * $Horde: chora/annotate.php,v 1.43 2004/01/17 22:57:25 jan Exp $
 *
 * Copyright 2000-2004 Anil Madhavapeddy <*****@*****.**>
 *
 * See the enclosed file COPYING for license information (GPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
 */
define('CHORA_BASE', dirname(__FILE__));
require_once CHORA_BASE . '/lib/base.php';
/* Spawn the file object. */
$fl =& $VC->getFileObject($where);
/* Retrieve the desired revision from the GET variable. */
$rev = Util::getFormData('rev', '1.1');
if (!VC_Revision::valid($rev)) {
    Chora::fatal('404 Not Found', "Revision {$rev} not found");
}
$ann =& $VC->getAnnotateObject($fl);
Chora::checkError($lines = $ann->doAnnotate($rev));
$title = sprintf(_("Source Annotation of %s for version %s"), Text::htmlAllSpaces($where), $rev);
$extraLink = sprintf('<a href="%s">%s</a> <b>|</b> <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';
Chora::menu();
require CHORA_TEMPLATES . '/headerbar.inc';
require CHORA_TEMPLATES . '/annotate/header.inc';
$author = '';
$style = 0;
foreach ($lines as $line) {
    $lineno = $line['lineno'];
    $prevAuthor = $author;
示例#4
0
文件: diff.php 项目: Artea/freebeer
    case 's':
        $type = 'column';
        break;
    case 'c':
        $type = 'context';
        break;
    case 'e':
        $type = 'ed';
        break;
    case 'u':
    case 'h':
    default:
        $type = 'unified';
}
/* Ensure that we have valid revision numbers. */
if (!VC_Revision::valid($r1) || !VC_Revision::valid($r2)) {
    Chora::fatal(_("Malformed Query"));
}
/* Cache the output of the diff for a week - it can be longer, since
 * it should never change */
header('Cache-Control: max-age=604800');
/* Title to use for html output pages */
$title = sprintf(_("Diff for %s between version %s and %s"), Text::htmlallspaces($where), $r1, $r2);
/* All is ok, proceed with the diff */
switch ($type) {
    case 'column':
        /* We'll need to know the mime type to modify diffs based on the mime
           type. */
        require_once HORDE_LIBS . 'Horde/MIME/Magic.php';
        $mime_type = MIME_Magic::filenameToMIME($fullname);
        if ($browser->isViewable($mime_type)) {