=================================================================== RCS file: /cvs/cvsweb/cvsweb.cgi,v retrieving revision 1.1.1.12 retrieving revision 3.35 diff -u -p -r1.1.1.12 -r3.35 --- cvsweb/cvsweb.cgi 2000/11/04 19:19:48 1.1.1.12 +++ cvsweb/cvsweb.cgi 2000/10/10 21:14:05 3.35 @@ -42,8 +42,8 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $zId: cvsweb.cgi,v 1.104 2000/11/01 22:05:12 hnordstrom Exp $ -# $kId: cvsweb.cgi,v 1.39 2000/11/04 15:32:17 knu Exp $ +# $zId: cvsweb.cgi,v 1.103 2000/09/20 17:02:29 jumager Exp $ +# $Id: cvsweb.cgi,v 3.35 2000/10/10 21:14:05 knu Exp $ # ### @@ -52,7 +52,6 @@ use strict; use vars qw ( $config $allow_version_select $verbose %CVSROOT %CVSROOTdescr %MIRRORS %DEFAULTVALUE %ICONS %MTYPES - @DIFFTYPES %DIFFTYPES @LOGSORTKEYS %LOGSORTKEYS %alltags @tabcolors %fileinfo %tags @branchnames %nameprinted %symrev %revsym @allrevisions %date %author @revdisplayorder @revisions %state %difflines %log %branchpoint @revorder @@ -62,7 +61,7 @@ use vars qw ( %funcline_regexp $is_mod_perl $is_links $is_lynx $is_w3m $is_msie $is_mozilla3 $is_textbased %input $query $barequery $sortby $bydate $byrev $byauthor - $bylog $byfile $defaultDiffType $logsort $cvstree $cvsroot + $bylog $byfile $hr_default $logsort $cvstree $cvsroot $mimetype $defaultTextPlain $defaultViewable $allow_compress $GZIPBIN $backicon $diricon $fileicon $fullname $newname $cvstreedefault $body_tag $body_tag_for_src @@ -84,10 +83,7 @@ use vars qw ( ); sub printDiffSelect($); -sub printDiffLinks($$); -sub printLogSortSelect($); sub findLastModifiedSubdirs(@); -sub htmlify_sub(&$); sub htmlify($;$); sub spacedHtmlText($;$); sub link($$); @@ -121,7 +117,6 @@ sub download_link($$$;$); sub toggleQuery($$); sub urlencode($); sub htmlquote($); -sub htmlunquote($); sub http_header(;$); sub html_header($); sub html_footer(); @@ -169,49 +164,6 @@ $tabstop = $use_moddate = $moddate = $gzip_open = unde $LOG_FILESEPARATOR = q/^={77}$/; $LOG_REVSEPARATOR = q/^-{28}$/; -@DIFFTYPES = qw(h H u c s); -@DIFFTYPES{@DIFFTYPES} = ( - { - 'descr' => 'colored', - 'opts' => [ '-u' ], - 'colored' => 1, - }, - { - 'descr' => 'long colored', - 'opts' => [ '--unified=15' ], - 'colored' => 1, - }, - { - 'descr' => 'unified', - 'opts' => [ '-u' ], - 'colored' => 0, - }, - { - 'descr' => 'context', - 'opts' => [ '-c' ], - 'colored' => 0, - }, - { - 'descr' => 'side by side', - 'opts' => [ '--side-by-side', '--width=164' ], - 'colored' => 0, - }, - ); - -@LOGSORTKEYS = qw(cvs date rev); -@LOGSORTKEYS{@LOGSORTKEYS} = ( - { - 'descr' => 'Not sorted', - }, - { - 'descr' => 'Commit date', - }, - { - 'descr' => 'Revision', - }, - ); - - ##### End of configuration variables ##### use Time::Local; @@ -375,7 +327,7 @@ else { $byfile = 1; } -$defaultDiffType = $input{'f'}; +$hr_default = $input{'f'} eq 'h'; $logsort = $input{'logsort'}; @@ -530,8 +482,9 @@ elsif (-d $fullname) { } print "\n"; $infocols++; - printf '"; $infocols++; - printf '"; if ($show_author) { $infocols++; - printf '"; } $infocols++; - printf '"; } elsif ($use_descriptions) { - printf '
', - $byfile ? $columnHeaderColorSorted : $columnHeaderColorDefault; + print "
"; if ($byfile) { print 'File'; } else { @@ -543,8 +496,9 @@ elsif (-d $fullname) { # with revision information: if (scalar(%fileinfo)) { $infocols++; - printf '', - $byrev ? $columnHeaderColorSorted : $columnHeaderColorDefault; + print ""; if ($byrev) { print 'Rev.'; } else { @@ -553,19 +507,21 @@ elsif (-d $fullname) { } print "', - $bydate ? $columnHeaderColorSorted : $columnHeaderColorDefault; + print ""; if ($bydate) { print 'Age'; } else { print &link('Age', sprintf('./%s#dirlist', - &toggleQuery("sortby", "date"))); + &toggleQuery("sortby", "date"))); } print "', - $byauthor ? $columnHeaderColorSorted : $columnHeaderColorDefault; + print ""; if ($byauthor) { print 'Author'; } else { @@ -575,18 +531,19 @@ elsif (-d $fullname) { print "', - $bylog ? $columnHeaderColorSorted : $columnHeaderColorDefault; + print ""; if ($bylog) { print 'Last log entry'; } else { print &link('Last log entry', sprintf('./%s#dirlist', - &toggleQuery("sortby", "log"))); + &toggleQuery("sortby", "log"))); } print "', $columnHeaderColorDefault; + print ""; print "Description"; $infocols++; } @@ -651,9 +608,9 @@ elsif (-d $fullname) { next if ($_ eq '..' && $where eq '/'); my ($rev,$date,$log,$author,$filename) = @{$fileinfo{$_}} if (defined($fileinfo{$_})); - printf '
', $tabcolors[$dirrow % 2] if $dirtable; + print "
" if ($dirtable); if ($_ eq '..') { - $url = "../$query"; + $url = "../" . $query; if ($nofilelinks) { print $backicon; } @@ -663,7 +620,7 @@ elsif (-d $fullname) { print " ", &link("Previous Directory", $url); } else { - $url = urlencode($_) . "/$query"; + $url = urlencode($_) . '/' . $query; print ""; if ($nofilelinks) { print $diricon; @@ -682,7 +639,7 @@ elsif (-d $fullname) { if ($filename) { print "  " if ($dirtable); if ($date) { - print " ", readableTime(time() - $date,0), ""; + print " " . readableTime(time() - $date,0) . ""; } if ($show_author) { print " " if ($dirtable); @@ -693,8 +650,8 @@ elsif (-d $fullname) { print "$filename/$rev"; print "
" if ($dirtable); if ($log) { - print " ", - &htmlify(substr($log,0,$shortLogLen)); + print " " + . &htmlify(substr($log,0,$shortLogLen)); if (length $log > 80) { print "..."; } @@ -704,7 +661,7 @@ elsif (-d $fullname) { else { my ($dwhere) = ($where ne "/" ? $where : "") . $_; if ($use_descriptions && defined $descriptions{$dwhere}) { - print "
 " if $dirtable; + print " " if $dirtable; print $descriptions{$dwhere}; } elsif ($dirtable && $infocols > 1) { # close the row with the appropriate number of @@ -735,7 +692,7 @@ elsif (-d $fullname) { next if (!defined($fileinfo{$_})); ($rev,$date,$log,$author) = @{$fileinfo{$_}}; $filesfound++; - printf '
', $tabcolors[$dirrow % 2] if $dirtable; + print "
" if ($dirtable); print ""; if ($nofilelinks) { print $fileicon; @@ -750,7 +707,7 @@ elsif (-d $fullname) { $defaultViewable ? "text/x-cvsweb-markup" : undef); print " " if ($dirtable); if ($date) { - print " ", readableTime(time() - $date,0), ""; + print " " . readableTime(time() - $date,0) . ""; } if ($show_author) { print " " if ($dirtable); @@ -758,7 +715,7 @@ elsif (-d $fullname) { } print " " if ($dirtable); if ($log) { - print " ", &htmlify(substr($log,0,$shortLogLen)); + print " " . &htmlify(substr($log,0,$shortLogLen)); if (length $log > 80) { print "..."; } @@ -773,7 +730,7 @@ elsif (-d $fullname) { if ($dirtable && defined($tableBorderColor)) { print "
"; } - print( $dirtable == 1 ? "\n" : "\n" ); + print "". ($dirtable == 1) ? "" : "" . "\n"; if ($filesexists && !$filesfound) { print "

NOTE: There are $filesexists files, but none matches the current tag ($input{only_with_tag})\n"; @@ -831,9 +788,12 @@ elsif (-d $fullname) { print "Revision"; print "Log message"; print ""; - print "Sort log by: "; - printLogSortSelect(0); - print ""; + print "revisions by: \n"; + print ""; print "Diff format: "; printDiffSelect(0); print ""; @@ -927,43 +887,18 @@ gzipclose(); sub printDiffSelect($) { my ($use_java_script) = @_; - my $f = $input{'f'}; - - print '\n"; + print "

\n";
@@ -2398,8 +2284,8 @@ sub doLog($) {
 	print "
\n"; print ""; print "\n"; - print ""; - print ""; + print "\n"; if (@branchnames) { @@ -2434,9 +2320,13 @@ sub doLog($) { print ""; - print ""; + print ""; print ""; print "\n"; print "
Preferred Diff type:"; + print "
Preferred Diff type:"; printDiffSelect($use_java_script); print "
"; print "\n"; print "Sort log by:"; - printLogSortSelect($use_java_script); - print "
"; @@ -2506,16 +2396,17 @@ sub human_readable_diff($){ $date2 = $r2d; } - print "

Diff for /$where_nd between version $rev1 and $rev2

\n", - "\n", - "\n", - "
", - "version $rev1"; + print "

Diff for /$where_nd between version $rev1 and $rev2

\n"; + + print "\n"; + print "\n"; + print "\n", - "\n"; + print "\n"; @@ -2640,7 +2531,7 @@ sub navigateHeader($$$$$) { $swhere = urlencode($filename) if ($swhere eq ""); print "<\!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"; print "\n\n"; - print ''; + print ''; print "\n$path$filename - $title - $rev\n"; print "$body_tag_for_src\n"; print "
"; + print "version $rev1"; print ", $date1" if (defined($date1)); print "
Tag: $sym1\n" if ($sym1); - print "
", - "version $rev2"; + print ""; + print "version $rev2"; print ", $date2" if (defined($date2)); print "
Tag: $sym2\n" if ($sym1); print "
"; @@ -2656,10 +2547,10 @@ sub navigateHeader($$$$$) { sub plural_write($$) { my ($num,$text) = @_; if ($num != 1) { - $text .= "s"; + $text = $text . "s"; } if ($num > 0) { - return join(' ', $num, $text); + return $num . " " . $text; } else { return ""; @@ -2703,7 +2594,7 @@ sub readableTime($$) { my $resttime = plural_write(int ($rest / $break), $desc{$break}); if ($resttime) { - $retval .= ", $resttime"; + $retval = $retval . ", " . $resttime; } } @@ -2733,8 +2624,8 @@ sub clickablePath($$) { my $wherepath = ''; my ($lastslash) = $pathname =~ m|/$|; foreach (split(/\//, $pathname)) { - $retval .= " / "; - $wherepath .= "/$_"; + $retval = $retval . " / "; + $wherepath = $wherepath . '/' . $_; my ($last) = "$wherepath/" eq "/$pathname" || $wherepath eq "/$pathname"; if ($clickLast || !$last) { @@ -2778,7 +2669,8 @@ sub chooseCVSRoot() { foreach $k (@foo) { print "\n"; + print ">" . ($CVSROOTdescr{$k} ? $CVSROOTdescr{$k} : + $k). "\n"; } print "\n"; print ""; @@ -2843,7 +2735,7 @@ sub fileSortCmp() { sub download_url($$;$) { my ($url,$revision,$mimetype) = @_; - $revision =~ s/\.0\././; + $revision =~ s/\b0\.//; if (defined($checkoutMagic) && (!defined($mimetype) || $mimetype ne "text/x-cvsweb-markup")) { @@ -2953,18 +2845,6 @@ sub htmlquote($) { $_; } -sub htmlunquote($) { - local($_) = @_; - - # Special Characters; RFC 1866 - s/"/\"/g; - s/<//g; - s/&/&/g; - - $_; -} - sub http_header(;$) { my $content_type = shift || "text/html"; if (defined($moddate)) { @@ -2972,7 +2852,7 @@ sub http_header(;$) { Apache->request->header_out("Last-Modified" => scalar gmtime($moddate) . " GMT"); } else { - print "Last-Modified: ", scalar gmtime($moddate), " GMT\r\n"; + print "Last-Modified: " . scalar gmtime($moddate) . " GMT\r\n"; } } if ($is_mod_perl) { @@ -3023,7 +2903,7 @@ sub http_header(;$) { sub html_header($) { my ($title) = @_; - my $version = '$zRevision: 1.104 $ $kRevision: 1.39 $'; #' + my $version = '$zRevision: 1.103 $ $Revision: 3.35 $'; #' http_header(); print <