version 1.1, 1999/12/27 20:19:55 |
version 1.3, 2000/07/11 08:20:53 |
|
|
# extended by Henner Zeller <zeller@think.de>, |
# extended by Henner Zeller <zeller@think.de>, |
# Henrik Nordström <hno@hem.passagen.se> |
# Henrik Nordström <hno@hem.passagen.se> |
# Ken Coar <coar@Apache.Org> |
# Ken Coar <coar@Apache.Org> |
|
# Dick Balaska <dick@buckosoft.com> |
# |
# |
# Based on: |
# Based on: |
# * Bill Fenners cvsweb.cgi revision 1.28 available from: |
# * Bill Fenners cvsweb.cgi revision 1.28 available from: |
|
|
$extern_window_width $extern_window_height $edit_option_form |
$extern_window_width $extern_window_height $edit_option_form |
$checkout_magic $show_subdir_lastmod $show_log_in_markup $v |
$checkout_magic $show_subdir_lastmod $show_log_in_markup $v |
$navigationHeaderColor $tableBorderColor $markupLogColor |
$navigationHeaderColor $tableBorderColor $markupLogColor |
$tabstop $state $annTable $sel $curbranch $HideModules @HideModules |
$tabstop $state $annTable $sel $curbranch @HideModules |
$module |
$module $use_descriptions %descriptions @mytz $dwhere $moddate |
|
$use_moddate |
); |
); |
|
|
##### Start of Configuration Area ######## |
##### Start of Configuration Area ######## |
# == EDIT this == |
# == EDIT this == |
# User configuration is stored in |
# User configuration is stored in |
$config = $ENV{'CVSWEB_CONFIG'} || '/usr/local/web/apache/conf/cvsweb.conf'; |
$config = $ENV{'CVSWEB_CONFIG'} || '/usr/local/etc/apache/cvsweb.conf'; |
|
|
# == Configuration defaults == |
# == Configuration defaults == |
# Defaults for configuration variables that shouldn't need |
# Defaults for configuration variables that shouldn't need |
Line 98 $allow_markup = $use_java_script = $open_extern_window |
|
Line 100 $allow_markup = $use_java_script = $open_extern_window |
|
$extern_window_width = $extern_window_height = $edit_option_form = |
$extern_window_width = $extern_window_height = $edit_option_form = |
$checkout_magic = $show_subdir_lastmod = $show_log_in_markup = $v = |
$checkout_magic = $show_subdir_lastmod = $show_log_in_markup = $v = |
$navigationHeaderColor = $tableBorderColor = $markupLogColor = |
$navigationHeaderColor = $tableBorderColor = $markupLogColor = |
$tabstop = undef; |
$tabstop = $use_moddate = $moddate = undef; |
|
|
##### End of configuration variables ##### |
##### End of configuration variables ##### |
|
|
Line 150 $maycompress =(($ENV{'HTTP_ACCEPT_ENCODING'} =~ m|gzip |
|
Line 152 $maycompress =(($ENV{'HTTP_ACCEPT_ENCODING'} =~ m|gzip |
|
|
|
if (-f $config) { |
if (-f $config) { |
do "$config"; |
do "$config"; |
$HideModules = "§" . join("§", @HideModules) . "§"; |
|
} |
} |
else { |
else { |
&fatal("500 Internal Error", |
&fatal("500 Internal Error", |
Line 204 foreach (@stickyvars) { |
|
Line 205 foreach (@stickyvars) { |
|
# construct a query string with the sticky non default parameters set |
# construct a query string with the sticky non default parameters set |
if (defined($input{$_}) && $input{$_} ne "" && $input{$_} ne $DEFAULTVALUE{$_}) { |
if (defined($input{$_}) && $input{$_} ne "" && $input{$_} ne $DEFAULTVALUE{$_}) { |
if ($barequery) { |
if ($barequery) { |
$barequery = $barequery . "&"; |
$barequery = $barequery . "&"; |
} |
} |
my $thisval = urlencode($_) . "=" . urlencode($input{$_}); |
my $thisval = urlencode($_) . "=" . urlencode($input{$_}); |
$barequery .= $thisval; |
$barequery .= $thisval; |
Line 213 foreach (@stickyvars) { |
|
Line 214 foreach (@stickyvars) { |
|
# is there any query ? |
# is there any query ? |
if ($barequery) { |
if ($barequery) { |
$query = "?$barequery"; |
$query = "?$barequery"; |
$barequery = "&" . $barequery; |
$barequery = "&" . $barequery; |
} |
} |
else { |
else { |
$query = ""; |
$query = ""; |
Line 346 elsif (-d $fullname) { |
|
Line 347 elsif (-d $fullname) { |
|
html_header("$where"); |
html_header("$where"); |
print $short_instruction; |
print $short_instruction; |
} |
} |
|
|
print "<P><a name=\"dirlist\">\n"; |
my $descriptions; |
|
if (($use_descriptions) && open (DESC, "<$cvsroot/CVSROOT/descriptions")) { |
|
while (<DESC>) { |
|
chomp; |
|
my ($dir,$description) = /(\S+)\s+(.*)/; |
|
$descriptions{$dir} = $description; |
|
} |
|
} |
|
|
|
print "<P><a name=\"dirlist\"></a>\n"; |
# give direct access to dirs |
# give direct access to dirs |
if ($where eq '/') { |
if ($where eq '/') { |
chooseMirror(); |
chooseMirror(); |
Line 362 elsif (-d $fullname) { |
|
Line 372 elsif (-d $fullname) { |
|
} |
} |
|
|
|
|
print "<P><HR NOSHADE>\n"; |
print "<HR NOSHADE>\n"; |
# Using <MENU> in this manner violates the HTML2.0 spec but |
# Using <MENU> in this manner violates the HTML2.0 spec but |
# provides the results that I want in most browsers. Another |
# provides the results that I want in most browsers. Another |
# case of layout spooging up HTML. |
# case of layout spooging up HTML. |
Line 375 elsif (-d $fullname) { |
|
Line 385 elsif (-d $fullname) { |
|
} |
} |
print "<table width=\"100%\" border=0 cellspacing=1 cellpadding=$tablepadding>\n"; |
print "<table width=\"100%\" border=0 cellspacing=1 cellpadding=$tablepadding>\n"; |
$infocols++; |
$infocols++; |
print "<tr><th align=left bgcolor=" . (($byfile) ? |
print "<tr><th align=left bgcolor=\"" . (($byfile) ? |
$columnHeaderColorSorted : |
$columnHeaderColorSorted : |
$columnHeaderColorDefault) . ">"; |
$columnHeaderColorDefault) . "\">"; |
print "<a href=\"./" . &toggleQuery("sortby","file") . |
print "<a href=\"./" . &toggleQuery("sortby","file") . |
"#dirlist\">" if (!$byfile); |
"#dirlist\">" if (!$byfile); |
print "File"; |
print "File"; |
Line 387 elsif (-d $fullname) { |
|
Line 397 elsif (-d $fullname) { |
|
# with revision information: |
# with revision information: |
if (scalar(%fileinfo)) { |
if (scalar(%fileinfo)) { |
$infocols++; |
$infocols++; |
print "<th align=left bgcolor=" . (($byrev) ? |
print "<th align=left bgcolor=\"" . (($byrev) ? |
$columnHeaderColorSorted : |
$columnHeaderColorSorted : |
$columnHeaderColorDefault) . ">"; |
$columnHeaderColorDefault) . "\">"; |
print "<a href=\"./" . &toggleQuery ("sortby","rev") . |
print "<a href=\"./" . &toggleQuery ("sortby","rev") . |
"#dirlist\">" if (!$byrev); |
"#dirlist\">" if (!$byrev); |
print "Rev."; |
print "Rev."; |
print "</a>" if (!$byrev); |
print "</a>" if (!$byrev); |
print "</th>"; |
print "</th>"; |
$infocols++; |
$infocols++; |
print "<th align=left bgcolor=" . (($bydate) ? |
print "<th align=left bgcolor=\"" . (($bydate) ? |
$columnHeaderColorSorted : |
$columnHeaderColorSorted : |
$columnHeaderColorDefault) . ">"; |
$columnHeaderColorDefault) . "\">"; |
print "<a href=\"./" . &toggleQuery ("sortby","date") . |
print "<a href=\"./" . &toggleQuery ("sortby","date") . |
"#dirlist\">" if (!$bydate); |
"#dirlist\">" if (!$bydate); |
print "Age"; |
print "Age"; |
Line 406 elsif (-d $fullname) { |
|
Line 416 elsif (-d $fullname) { |
|
print "</th>"; |
print "</th>"; |
if ($show_author) { |
if ($show_author) { |
$infocols++; |
$infocols++; |
print "<th align=left bgcolor=" . (($byauthor) ? |
print "<th align=left bgcolor=\"" . (($byauthor) ? |
$columnHeaderColorSorted : |
$columnHeaderColorSorted : |
$columnHeaderColorDefault) . ">"; |
$columnHeaderColorDefault) . "\">"; |
print "<a href=\"./" . &toggleQuery ("sortby","author") . |
print "<a href=\"./" . &toggleQuery ("sortby","author") . |
"#dirlist\">" if (!$byauthor); |
"#dirlist\">" if (!$byauthor); |
print "Author"; |
print "Author"; |
Line 416 elsif (-d $fullname) { |
|
Line 426 elsif (-d $fullname) { |
|
print "</th>"; |
print "</th>"; |
} |
} |
$infocols++; |
$infocols++; |
print "<th align=left bgcolor=" . (($bylog) ? |
print "<th align=left bgcolor=\"" . (($bylog) ? |
$columnHeaderColorSorted : |
$columnHeaderColorSorted : |
$columnHeaderColorDefault) . ">"; |
$columnHeaderColorDefault) . "\">"; |
print "<a href=\"./", toggleQuery("sortby","log"), "#dirlist\">" if (!$bylog); |
print "<a href=\"./", toggleQuery("sortby","log"), "#dirlist\">" if (!$bylog); |
print "Last log entry"; |
print "Last log entry"; |
print "</a>" if (!$bylog); |
print "</a>" if (!$bylog); |
print "</th>"; |
print "</th>"; |
} |
} |
|
elsif ($use_descriptions) { |
|
print "<th align=left bgcolor=\"". $columnHeaderColorDefault . "\">"; |
|
print "Description"; |
|
$infocols++; |
|
} |
print "</tr>\n"; |
print "</tr>\n"; |
} |
} |
else { |
else { |
Line 498 elsif (-d $fullname) { |
|
Line 513 elsif (-d $fullname) { |
|
} |
} |
else { |
else { |
$url = urlencode($_) . '/' . $query; |
$url = urlencode($_) . '/' . $query; |
print "<A NAME=\"$_\">"; |
print "<A NAME=\"$_\"></A>"; |
if ($nofilelinks) { |
if ($nofilelinks) { |
print $diricon; |
print $diricon; |
} |
} |
Line 514 elsif (-d $fullname) { |
|
Line 529 elsif (-d $fullname) { |
|
} |
} |
# Show last change in dir |
# Show last change in dir |
if ($filename) { |
if ($filename) { |
print "</td><td> </td><td> " if ($dirtable); |
print "</td><td> </td><td> " if ($dirtable); |
if ($date) { |
if ($date) { |
print " <i>" . readableTime(time() - $date,0) . "</i>"; |
print " <i>" . readableTime(time() - $date,0) . "</i>"; |
} |
} |
Line 536 elsif (-d $fullname) { |
|
Line 551 elsif (-d $fullname) { |
|
} |
} |
} |
} |
else { |
else { |
# if there are any files (which require infocols), close the |
my ($dwhere) = ($where ne "/" ? $where : "") . $_; |
# row with the appropriate number of columns, so that the |
if ($use_descriptions && defined $descriptions{$dwhere}) { |
# vertical seperators are visible |
print "<TD COLSPAN=" . ($infocols-1) . "> " if $dirtable; |
if ($dirtable && scalar(%fileinfo)) { |
print $descriptions{$dwhere}; |
print "</td>"; |
} elsif ($dirtable && $infocols > 1) { |
|
# close the row with the appropriate number of |
|
# columns, so that the vertical seperators are visible |
my($cols) = $infocols; |
my($cols) = $infocols; |
while ($cols > 1) { |
while ($cols > 1) { |
print "<td> </td>"; |
print "</td><td> "; |
$cols--; |
$cols--; |
} |
} |
} |
} |
Line 568 elsif (-d $fullname) { |
|
Line 585 elsif (-d $fullname) { |
|
($rev,$date,$log,$author) = @{$fileinfo{$_}}; |
($rev,$date,$log,$author) = @{$fileinfo{$_}}; |
$filesfound++; |
$filesfound++; |
print "<tr bgcolor=\"" . @tabcolors[$dirrow%2] . "\"><td>" if ($dirtable); |
print "<tr bgcolor=\"" . @tabcolors[$dirrow%2] . "\"><td>" if ($dirtable); |
print "<A NAME=\"$_\">"; |
print "<A NAME=\"$_\"></A>"; |
if ($nofilelinks) { |
if ($nofilelinks) { |
print $fileicon; |
print $fileicon; |
} |
} |
Line 1146 sub doCheckout { |
|
Line 1163 sub doCheckout { |
|
} |
} |
|
|
if (defined($rev)) { |
if (defined($rev)) { |
$revopt = "-r'$rev'"; |
$revopt = "-r$rev"; |
|
if ($use_moddate) { |
|
readLog($fullname,$rev); |
|
$moddate=$date{$rev}; |
|
} |
} |
} |
else { |
else { |
$revopt = ""; |
$revopt = ""; |
|
if ($use_moddate) { |
|
readLog($fullname); |
|
$moddate=$date{$symrev{HEAD}}; |
|
} |
} |
} |
|
|
# this may not be quoted with single quotes |
|
# in windows .. but should in U*nx. there |
|
# is a function which allows for quoting `evil` |
|
# characters somewhere, I know (buried in the Perl-manpage) |
|
## |
|
### just for the record: |
### just for the record: |
### 'cvs co' seems to have a bug regarding single checkout of |
### 'cvs co' seems to have a bug regarding single checkout of |
### directories/files having spaces in it; |
### directories/files having spaces in it; |
### this is an issue that should be resolved on cvs's side |
### this is an issue that should be resolved on cvs's side |
open($fh, "cvs -d'$cvsroot' co -p $revopt '$where' 2>&1 |") || |
# |
&fatal("500 Internal Error", "Couldn't co: $!"); |
# Safely for a child process to read from. |
|
if (! open($fh, "-|")) { # child |
|
open(STDERR, ">&STDOUT"); # Redirect stderr to stdout |
|
exec("cvs", "-d$cvsroot", "co", "-p", $revopt, $where); |
|
} |
#=================================================================== |
#=================================================================== |
#Checking out squid/src/ftp.c |
#Checking out squid/src/ftp.c |
#RCS: /usr/src/CVS/squid/src/ftp.c,v |
#RCS: /usr/src/CVS/squid/src/ftp.c,v |
Line 1175 sub doCheckout { |
|
Line 1199 sub doCheckout { |
|
last if (/^\*\*\*\*/); |
last if (/^\*\*\*\*/); |
$revision = $1 if (/^VERS: (.*)$/); |
$revision = $1 if (/^VERS: (.*)$/); |
$filename = $1 if (/^Checking out (.*)$/); |
$filename = $1 if (/^Checking out (.*)$/); |
|
$filename =~ s/^\.\/*//; |
$cvsheader .= $_; |
$cvsheader .= $_; |
} |
} |
if ($filename ne $where) { |
if ($filename ne $where) { |
Line 1211 sub cvswebMarkup { |
|
Line 1236 sub cvswebMarkup { |
|
navigateHeader ($scriptwhere, $pathname, $filename, $revision, "view"); |
navigateHeader ($scriptwhere, $pathname, $filename, $revision, "view"); |
print "<HR noshade>"; |
print "<HR noshade>"; |
print "<table width=\"100%\"><tr><td bgcolor=\"$markupLogColor\">"; |
print "<table width=\"100%\"><tr><td bgcolor=\"$markupLogColor\">"; |
print "File: ", &clickablePath($where, 1), "</b>"; |
print "File: ", &clickablePath($where, 1); |
print " "; |
print " "; |
&download_link(urlencode($fileurl), $revision, "(download)"); |
&download_link(urlencode($fileurl), $revision, "(download)"); |
if (!$defaultTextPlain) { |
if (!$defaultTextPlain) { |
Line 1239 sub cvswebMarkup { |
|
Line 1264 sub cvswebMarkup { |
|
else { |
else { |
print "<PRE>"; |
print "<PRE>"; |
foreach (@content) { |
foreach (@content) { |
print htmlify($_); |
print spacedHtmlText($_); |
} |
} |
print "</PRE>"; |
print "</PRE>"; |
} |
} |
Line 1259 sub viewable($) { |
|
Line 1284 sub viewable($) { |
|
sub doDiff { |
sub doDiff { |
my($fullname, $r1, $tr1, $r2, $tr2, $f) = @_; |
my($fullname, $r1, $tr1, $r2, $tr2, $f) = @_; |
my $fh = do {local(*FH);}; |
my $fh = do {local(*FH);}; |
my ($rev1, $rev2, $sym1, $sym2, $difftype, $diffname, $f1, $f2); |
my ($rev1, $rev2, $sym1, $sym2, @difftype, $diffname, $f1, $f2); |
|
|
if ($r1 =~ /([^:]+)(:(.+))?/) { |
if ($r1 =~ /([^:]+)(:(.+))?/) { |
$rev1 = $1; |
$rev1 = $1; |
|
|
} |
} |
my $human_readable = 0; |
my $human_readable = 0; |
if ($f eq 'c') { |
if ($f eq 'c') { |
$difftype = '-c'; |
@difftype = qw{-c}; |
$diffname = "Context diff"; |
$diffname = "Context diff"; |
} |
} |
elsif ($f eq 's') { |
elsif ($f eq 's') { |
$difftype = '--side-by-side --width=164'; |
@difftype = qw{--side-by-side --width=164}; |
$diffname = "Side by Side"; |
$diffname = "Side by Side"; |
} |
} |
elsif ($f eq 'H') { |
elsif ($f eq 'H') { |
$human_readable = 1; |
$human_readable = 1; |
$difftype = '--unified=15'; |
@difftype = qw{--unified=15}; |
$diffname = "Long Human readable"; |
$diffname = "Long Human readable"; |
} |
} |
elsif ($f eq 'h') { |
elsif ($f eq 'h') { |
$difftype = '-u'; |
@difftype =qw{-u}; |
$human_readable = 1; |
$human_readable = 1; |
$diffname = "Human readable"; |
$diffname = "Human readable"; |
} |
} |
elsif ($f eq 'u') { |
elsif ($f eq 'u') { |
$difftype = '-u'; |
@difftype = qw{-u}; |
$diffname = "Unidiff"; |
$diffname = "Unidiff"; |
} |
} |
else { |
else { |
|
|
# apply special options |
# apply special options |
if ($human_readable) { |
if ($human_readable) { |
if ($hr_funout) { |
if ($hr_funout) { |
$difftype = $difftype . ' -p'; |
push @difftype, '-p'; |
} |
} |
if ($hr_ignwhite) { |
if ($hr_ignwhite) { |
$difftype = $difftype . ' -w'; |
push @difftype, '-w'; |
} |
} |
if ($hr_ignkeysubst) { |
if ($hr_ignkeysubst) { |
$difftype = $difftype . ' -kk'; |
push @difftype, '-kk'; |
} |
} |
} |
} |
## cvs rdiff doesn't support '-p' and '-w' option .. sad |
if (! open($fh, "-|")) { # child |
# open($fh, "cvs -d $cvsroot rdiff $difftype " . |
open(STDERR, ">&STDOUT"); # Redirect stderr to stdout |
# "-r$rev1 -r$rev2 '$where' 2>&1 |") |
exec("rcsdiff",@difftype,"-r$rev1","-r$rev2",$fullname); |
# || &fatal("500 Internal Error", "Couldn't cvs rdiff: $!"); |
} |
### |
|
open($fh, "rcsdiff $difftype -r$rev1 -r$rev2 '$fullname' 2>&1 |") |
|
|| &fatal("500 Internal Error", "Couldn't GNU rcsdiff: $!"); |
|
if ($human_readable) { |
if ($human_readable) { |
http_header(); |
http_header(); |
&human_readable_diff($fh, $rev2); |
&human_readable_diff($fh, $rev2); |
|
|
#--- src/sys/netinet/tcp_output.c 1995/12/05 17:46:35 1.17 RELENG_2_1_0 |
#--- src/sys/netinet/tcp_output.c 1995/12/05 17:46:35 1.17 RELENG_2_1_0 |
# (bogus example, but...) |
# (bogus example, but...) |
# |
# |
if ($difftype eq '-u') { |
if (grep { $_ eq '-u'} @difftype) { |
$f1 = '---'; |
$f1 = '---'; |
$f2 = '\+\+\+'; |
$f2 = '\+\+\+'; |
} |
} |
Line 1416 sub getDirLogs { |
|
Line 1438 sub getDirLogs { |
|
return; |
return; |
} |
} |
|
|
my ($filenames) = join("' '",@files); |
|
if ($tag) { |
if ($tag) { |
#can't use -r<tag> as - is allowed in tagnames, but misinterpreated by rlog.. |
#can't use -r<tag> as - is allowed in tagnames, but misinterpreated by rlog.. |
open($fh, "rlog '$filenames' 2>/dev/null |") |
if (! open($fh, "-|")) { |
|| &fatal("500 Internal Error", "Failed to spawn GNU rlog"); |
close(STDERR); # rlog may complain; ignore. |
|
exec("rlog",@files); |
|
} |
} |
} |
else { |
else { |
open($fh, "rlog -r '$filenames' 2>/dev/null |") |
my $kidpid = open($fh, "-|"); |
|| &fatal("500 Internal Error", "Failed to spawn GNU rlog"); |
if (! $kidpid) { |
|
close(STDERR); # rlog may complain; ignore. |
|
exec("rlog","-r",@files); |
|
} |
} |
} |
$state = "start"; |
$state = "start"; |
while (<$fh>) { |
while (<$fh>) { |
|
|
$date = undef; |
$date = undef; |
$log = ""; |
$log = ""; |
# Try to reconstruct the relative filename if RCS spits out a full path |
# Try to reconstruct the relative filename if RCS spits out a full path |
$filename =~ s%^$DirName/%%; |
$filename =~ s%^\Q$DirName\E/%%; |
next; |
next; |
} |
} |
if ($state eq "log") { |
if ($state eq "log") { |
|
|
} |
} |
if ($. == 0) { |
if ($. == 0) { |
fatal("500 Internal Error", |
fatal("500 Internal Error", |
"Failed to spawn GNU rlog on <em>'$filenames'</em><p>did you set the <b>\$ENV{PATH}</b> in your configuration file correctly ?"); |
"Failed to spawn GNU rlog on <em>'".join(", ", @files)."'</em><p>did you set the <b>\$ENV{PATH}</b> in your configuration file correctly ?"); |
} |
} |
close($fh); |
close($fh); |
} |
} |
|
|
undef %log; |
undef %log; |
|
|
print("Going to rlog '$fullname'\n") if ($verbose); |
print("Going to rlog '$fullname'\n") if ($verbose); |
open($fh, "rlog $revision '$fullname'|") |
if (! open($fh, "-|")) { # child |
|| &fatal("500 Internal Error", "Failed to spawn rlog"); |
if ($revision ne '') { |
|
exec("rlog",$revision,$fullname); |
|
} |
|
else { |
|
exec("rlog",$fullname); |
|
} |
|
} |
while (<$fh>) { |
while (<$fh>) { |
print if ($verbose); |
print if ($verbose); |
if ($symnames) { |
if ($symnames) { |
Line 1843 sub printLog($;$) { |
|
Line 1874 sub printLog($;$) { |
|
if (/^1\.1\.1\.\d+$/) { |
if (/^1\.1\.1\.\d+$/) { |
print " <i>(vendor branch)</i>"; |
print " <i>(vendor branch)</i>"; |
} |
} |
print ", <i>" . scalar gmtime($date{$_}) . " UTC</i> ("; |
if (defined @mytz) { |
|
my ($est) = $mytz[(localtime($date{$_}))[8]]; |
|
print ", <i>" . scalar localtime($date{$_}) . " $est</i> ("; |
|
} else { |
|
print ", <i>" . scalar gmtime($date{$_}) . " UTC</i> ("; |
|
} |
print readableTime(time() - $date{$_},1) . " ago)"; |
print readableTime(time() - $date{$_},1) . " ago)"; |
print " by "; |
print " by "; |
print "<i>" . $author{$_} . "</i>\n"; |
print "<i>" . $author{$_} . "</i>\n"; |
Line 1881 sub printLog($;$) { |
|
Line 1917 sub printLog($;$) { |
|
if ($prev) { |
if ($prev) { |
$diffrev{$prev} = 1; |
$diffrev{$prev} = 1; |
print " to previous <A HREF=\"${scriptwhere}.diff?r1=$prev"; |
print " to previous <A HREF=\"${scriptwhere}.diff?r1=$prev"; |
print "&r2=$_" . $barequery . "\">$prev</A>\n"; |
print "&r2=$_" . $barequery . "\">$prev</A>\n"; |
if (!$hr_default) { # offer a human readable version if not default |
if (!$hr_default) { # offer a human readable version if not default |
print "(<A HREF=\"${scriptwhere}.diff?r1=$prev"; |
print "(<A HREF=\"${scriptwhere}.diff?r1=$prev"; |
print "&r2=$_" . $barequery . "&f=h\">colored</A>)\n"; |
print "&r2=$_" . $barequery . "&f=h\">colored</A>)\n"; |
} |
} |
} |
} |
# |
# |
Line 1892 sub printLog($;$) { |
|
Line 1928 sub printLog($;$) { |
|
# offer a diff with the branch point. |
# offer a diff with the branch point. |
if ($revsym{$brp} && !/^1\.1\.1\.\d+$/ && !defined($diffrev{$brp})) { |
if ($revsym{$brp} && !/^1\.1\.1\.\d+$/ && !defined($diffrev{$brp})) { |
print " to branchpoint <A HREF=\"${scriptwhere}.diff?r1=$brp"; |
print " to branchpoint <A HREF=\"${scriptwhere}.diff?r1=$brp"; |
print "&r2=$_" . $barequery . "\">$brp</A>\n"; |
print "&r2=$_" . $barequery . "\">$brp</A>\n"; |
if (!$hr_default) { # offer a human readable version if not default |
if (!$hr_default) { # offer a human readable version if not default |
print "(<A HREF=\"${scriptwhere}.diff?r1=$brp"; |
print "(<A HREF=\"${scriptwhere}.diff?r1=$brp"; |
print "&r2=$_" . $barequery . "&f=h\">colored</A>)\n"; |
print "&r2=$_" . $barequery . "&f=h\">colored</A>)\n"; |
} |
} |
} |
} |
# |
# |
Line 1922 sub printLog($;$) { |
|
Line 1958 sub printLog($;$) { |
|
if (!defined($diffrev{$nextmain})) { |
if (!defined($diffrev{$nextmain})) { |
$diffrev{$nextmain} = 1; |
$diffrev{$nextmain} = 1; |
print " next main <A HREF=\"${scriptwhere}.diff?r1=$nextmain"; |
print " next main <A HREF=\"${scriptwhere}.diff?r1=$nextmain"; |
print "&r2=$_" . $barequery . |
print "&r2=$_" . $barequery . |
"\">$nextmain</A>\n"; |
"\">$nextmain</A>\n"; |
if (!$hr_default) { # offer a human readable version if not default |
if (!$hr_default) { # offer a human readable version if not default |
print "(<A HREF=\"${scriptwhere}.diff?r1=$nextmain"; |
print "(<A HREF=\"${scriptwhere}.diff?r1=$nextmain"; |
print "&r2=$_" . $barequery . |
print "&r2=$_" . $barequery . |
"&f=h\">colored</A>)\n"; |
"&f=h\">colored</A>)\n"; |
} |
} |
} |
} |
} |
} |
Line 1936 sub printLog($;$) { |
|
Line 1972 sub printLog($;$) { |
|
if (defined($input{"r1"}) && !defined($diffrev{$input{"r1"}})) { |
if (defined($input{"r1"}) && !defined($diffrev{$input{"r1"}})) { |
$diffrev{$input{"r1"}} = 1; |
$diffrev{$input{"r1"}} = 1; |
print " to selected <A HREF=\"${scriptwhere}.diff?" |
print " to selected <A HREF=\"${scriptwhere}.diff?" |
. "r1=$input{'r1'}&r2=$_" . $barequery |
. "r1=$input{'r1'}&r2=$_" . $barequery |
. "\">$input{'r1'}</A>\n"; |
. "\">$input{'r1'}</A>\n"; |
if (!$hr_default) { # offer a human readable version if not default |
if (!$hr_default) { # offer a human readable version if not default |
print "(<A HREF=\"${scriptwhere}.diff?r1=$input{'r1'}"; |
print "(<A HREF=\"${scriptwhere}.diff?r1=$input{'r1'}"; |
print "&r2=$_" . $barequery . |
print "&r2=$_" . $barequery . |
"&f=h\">colored</A>)\n"; |
"&f=h\">colored</A>)\n"; |
|
|
} |
} |
} |
} |
|
|
printLog($revdisplayorder[$i]); |
printLog($revdisplayorder[$i]); |
} |
} |
|
|
print "<A NAME=diff>\n"; |
|
print "<HR NOSHADE>"; |
print "<HR NOSHADE>"; |
|
print "<A NAME=diff>\n"; |
print "This form allows you to request diff's between any two\n"; |
print "This form allows you to request diff's between any two\n"; |
print "revisions of a file. You may select a symbolic revision\n"; |
print "revisions of a file. You may select a symbolic revision\n"; |
print "name using the selection box or you may type in a numeric\n"; |
print "name using the selection box or you may type in a numeric\n"; |
|
|
print "</FORM>\n"; |
print "</FORM>\n"; |
print "<HR noshade>\n"; |
print "<HR noshade>\n"; |
if (@branchnames) { |
if (@branchnames) { |
print "<A name=branch>\n"; |
print "<A name=branch></A>\n"; |
print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n"; |
print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n"; |
foreach (@stickyvars) { |
foreach (@stickyvars) { |
next if ($_ eq "only_with_tag"); |
next if ($_ eq "only_with_tag"); |
|
|
print "</SELECT>\n"; |
print "</SELECT>\n"; |
print "<INPUT TYPE=SUBMIT VALUE=\" View Branch \">\n"; |
print "<INPUT TYPE=SUBMIT VALUE=\" View Branch \">\n"; |
print "</FORM>\n"; |
print "</FORM>\n"; |
print "</A>\n"; |
|
} |
} |
print "<A name=logsort>\n"; |
print "<A name=logsort></A>\n"; |
print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n"; |
print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n"; |
foreach (@stickyvars) { |
foreach (@stickyvars) { |
next if ($_ eq "only_with_tag"); |
next if ($_ eq "only_with_tag"); |
|
|
print "</SELECT>\n"; |
print "</SELECT>\n"; |
print "<INPUT TYPE=SUBMIT VALUE=\" Sort \">\n"; |
print "<INPUT TYPE=SUBMIT VALUE=\" Sort \">\n"; |
print "</FORM>\n"; |
print "</FORM>\n"; |
print "</A>"; |
|
print &html_footer; |
print &html_footer; |
print "</BODY></HTML>\n"; |
print "</BODY></HTML>\n"; |
} |
} |
Line 2136 sub human_readable_diff($){ |
|
Line 2170 sub human_readable_diff($){ |
|
|
|
print "<h3 align=center>Diff for /$where_nd between version $rev1 and $rev2</h3>\n"; |
print "<h3 align=center>Diff for /$where_nd between version $rev1 and $rev2</h3>\n"; |
|
|
print "<table border=0 cellspacing=0 cellpadding=0 width=100%>\n"; |
print "<table border=0 cellspacing=0 cellpadding=0 width=\"100%\">\n"; |
print "<tr bgcolor=#ffffff>\n"; |
print "<tr bgcolor=\"#ffffff\">\n"; |
print "<th width=\"50%\" valign=TOP>"; |
print "<th width=\"50%\" valign=TOP>"; |
print "version $rev1"; |
print "version $rev1"; |
print ", $date1" if (defined($date1)); |
print ", $date1" if (defined($date1)); |
Line 2167 sub human_readable_diff($){ |
|
Line 2201 sub human_readable_diff($){ |
|
if ($difftxt =~ /^@@/) { |
if ($difftxt =~ /^@@/) { |
($oldline,$newline,$funname) = $difftxt =~ /@@ \-([0-9]+).*\+([0-9]+).*@@(.*)/; |
($oldline,$newline,$funname) = $difftxt =~ /@@ \-([0-9]+).*\+([0-9]+).*@@(.*)/; |
print "<tr bgcolor=\"$diffcolorHeading\"><td width=\"50%\">"; |
print "<tr bgcolor=\"$diffcolorHeading\"><td width=\"50%\">"; |
print "<table width=100% border=1 cellpadding=5><tr><td><b>Line $oldline</b>"; |
print "<table width=\"100%\" border=1 cellpadding=5><tr><td><b>Line $oldline</b>"; |
print " <font size=-1>$funname</font></td></tr></table>"; |
print " <font size=-1>$funname</font></td></tr></table>"; |
print "</td><td width=\"50%\">"; |
print "</td><td width=\"50%\">"; |
print "<table width=100% border=1 cellpadding=5><tr><td><b>Line $newline</b>"; |
print "<table width=\"100%\" border=1 cellpadding=5><tr><td><b>Line $newline</b>"; |
print " <font size=-1>$funname</font></td></tr></table>"; |
print " <font size=-1>$funname</font></td></tr></table>"; |
print "</td><tr>\n"; |
print "</td>\n"; |
$state = "dump"; |
$state = "dump"; |
$leftRow = 0; |
$leftRow = 0; |
$rightRow = 0; |
$rightRow = 0; |
Line 2226 sub human_readable_diff($){ |
|
Line 2260 sub human_readable_diff($){ |
|
print "</table>"; |
print "</table>"; |
close($fh); |
close($fh); |
|
|
print "<br><hr noshade width=100%>\n"; |
print "<br><hr noshade width=\"100%\">\n"; |
|
|
print "<table border=0>"; |
print "<table border=0>"; |
|
|
Line 2238 sub human_readable_diff($){ |
|
Line 2272 sub human_readable_diff($){ |
|
print "<tr bgcolor=\"$diffcolorChange\"><td align=center colspan=2>changed lines</td></tr>"; |
print "<tr bgcolor=\"$diffcolorChange\"><td align=center colspan=2>changed lines</td></tr>"; |
print "<tr><td bgcolor=\"$diffcolorEmpty\"> </td><td align=center bgcolor=\"$diffcolorAdd\">Added in v.$rev2</td></tr>"; |
print "<tr><td bgcolor=\"$diffcolorEmpty\"> </td><td align=center bgcolor=\"$diffcolorAdd\">Added in v.$rev2</td></tr>"; |
print "</table></td></tr></table>\n"; |
print "</table></td></tr></table>\n"; |
print "</body>\n</html>\n"; |
|
|
|
print "<td>"; |
print "<td>"; |
# Print format selector |
# Print format selector |
Line 2262 sub navigateHeader ($$$$$) { |
|
Line 2295 sub navigateHeader ($$$$$) { |
|
my ($swhere,$path,$filename,$rev,$title) = @_; |
my ($swhere,$path,$filename,$rev,$title) = @_; |
$swhere = "" if ($swhere eq $scriptwhere); |
$swhere = "" if ($swhere eq $scriptwhere); |
$swhere = urlencode($filename) if ($swhere eq ""); |
$swhere = urlencode($filename) if ($swhere eq ""); |
|
print "<\!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"; |
print "<HTML>\n<HEAD>\n"; |
print "<HTML>\n<HEAD>\n"; |
print '<!-- hennerik CVSweb $Revision$ -->'; |
print '<!-- hennerik CVSweb $Revision$ -->'; |
print "\n<TITLE>$path$filename - $title - $rev</TITLE></HEAD>\n"; |
print "\n<TITLE>$path$filename - $title - $rev</TITLE></HEAD>\n"; |
Line 2476 sub download_url { |
|
Line 2510 sub download_url { |
|
$url = "$scriptname/$checkoutMagic/${path}$url"; |
$url = "$scriptname/$checkoutMagic/${path}$url"; |
} |
} |
$url .= "?rev=$revision"; |
$url .= "?rev=$revision"; |
$url .= "&content-type=$mimetype" if (defined($mimetype)); |
$url .= "&content-type=$mimetype" if (defined($mimetype)); |
|
|
return $url; |
return $url; |
} |
} |
Line 2545 sub toggleQuery($$) { |
|
Line 2579 sub toggleQuery($$) { |
|
my ($value) = defined($vars{$var}) ? $vars{$var} : ""; |
my ($value) = defined($vars{$var}) ? $vars{$var} : ""; |
my ($default) = defined($DEFAULTVALUE{$var}) ? $DEFAULTVALUE{$var} : ""; |
my ($default) = defined($DEFAULTVALUE{$var}) ? $DEFAULTVALUE{$var} : ""; |
if ($value ne $default) { |
if ($value ne $default) { |
$newquery .= "&" if ($newquery ne ""); |
$newquery .= "&" if ($newquery ne ""); |
$newquery .= urlencode($var) . "=" . urlencode($value); |
$newquery .= urlencode($var) . "=" . urlencode($value); |
} |
} |
} |
} |
Line 2565 sub urlencode { |
|
Line 2599 sub urlencode { |
|
sub http_header { |
sub http_header { |
my $content_type = shift || "text/html"; |
my $content_type = shift || "text/html"; |
my $is_mod_perl = defined($ENV{'MOD_PERL'}); |
my $is_mod_perl = defined($ENV{'MOD_PERL'}); |
|
if (defined($moddate)) { |
|
if ($is_mod_perl) { |
|
Apache->request->header_out(Last_modified => scalar gmtime($moddate) . " GMT"); |
|
} |
|
else { |
|
print "Last-Modified: " . scalar gmtime($moddate) . " GMT\n"; |
|
} |
|
} |
if ($is_mod_perl) { |
if ($is_mod_perl) { |
Apache->request->content_type($content_type); |
Apache->request->content_type($content_type); |
} |
} |
Line 2610 sub http_header { |
|
Line 2652 sub http_header { |
|
|
|
sub html_header($) { |
sub html_header($) { |
my ($title) = @_; |
my ($title) = @_; |
|
my $version = '$Revision$'; |
http_header(); |
http_header(); |
print <<EOH; |
print <<EOH; |
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" |
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" |
"http://www.w3.org/TR/REC-html40/loose.dtd"> |
"http://www.w3.org/TR/REC-html40/loose.dtd"> |
<html> |
<html> |
<title>$title</title> |
<title>$title</title> |
<!-- hennerik CVSweb \$Revision$ \--> |
<!-- hennerik CVSweb $version --> |
</head> |
</head> |
$body_tag |
$body_tag |
$logo <h1 align="center">$title</h1> |
$logo <h1 align="center">$title</h1> |
|
|
# |
# |
sub forbidden_module { |
sub forbidden_module { |
my($module) = @_; |
my($module) = @_; |
|
|
|
for (my $i=0; $i < @HideModules; $i++) { |
|
return 1 if $module eq $HideModules[$i]; |
|
} |
|
|
return ("§$module§" =~ /$HideModules/); |
return 0; |
} |
} |