version 3.14, 2000/08/24 15:53:11 |
version 3.21, 2000/09/11 17:11:03 |
|
|
%CVSROOT %CVSROOTdescr %MIRRORS %DEFAULTVALUE %ICONS %MTYPES |
%CVSROOT %CVSROOTdescr %MIRRORS %DEFAULTVALUE %ICONS %MTYPES |
%alltags @tabcolors %fileinfo %tags @branchnames %nameprinted |
%alltags @tabcolors %fileinfo %tags @branchnames %nameprinted |
%symrev %revsym @allrevisions %date %author @revdisplayorder |
%symrev %revsym @allrevisions %date %author @revdisplayorder |
@revisions %state %difflines %log %branchpoint @revorder $prcgi |
@revisions %state %difflines %log %branchpoint @revorder |
@prcategories $prcategories |
$prcgi @prcategories $prcategories $mancgi |
$checkoutMagic $doCheckout $scriptname $scriptwhere |
$checkoutMagic $doCheckout $scriptname $scriptwhere |
$where $pathinfo $Browser $nofilelinks $maycompress @stickyvars |
$where $pathinfo $Browser $nofilelinks $maycompress @stickyvars |
%funcline_regexp $is_mod_perl |
%funcline_regexp $is_mod_perl |
|
|
sub printDiffSelect($); |
sub printDiffSelect($); |
sub findLastModifiedSubdirs(@); |
sub findLastModifiedSubdirs(@); |
sub htmlify($;$); |
sub htmlify($;$); |
sub spacedHtmlText($); |
sub spacedHtmlText($;$); |
sub link($$); |
sub link($$); |
sub revcmp($$); |
sub revcmp($$); |
sub fatal($$); |
sub fatal($$); |
Line 347 foreach my $k (keys %ICONS) { |
|
Line 347 foreach my $k (keys %ICONS) { |
|
do "$config-$cvstree" if (-f "$config-$cvstree"); |
do "$config-$cvstree" if (-f "$config-$cvstree"); |
|
|
$prcategories = '(?:' . join('|', @prcategories) . ')'; |
$prcategories = '(?:' . join('|', @prcategories) . ')'; |
|
$prcgi .= '%s' if defined($prcgi) && $prcgi !~ /%s/; |
|
|
$fullname = $cvsroot . '/' . $where; |
$fullname = $cvsroot . '/' . $where; |
$mimetype = &getMimeTypeFromSuffix ($fullname); |
$mimetype = &getMimeTypeFromSuffix ($fullname); |
Line 886 sub findLastModifiedSubdirs(@) { |
|
Line 887 sub findLastModifiedSubdirs(@) { |
|
} |
} |
|
|
sub htmlify($;$) { |
sub htmlify($;$) { |
my($string, $pr) = @_; |
my($string, $extra) = @_; |
|
|
# Special Characters; RFC 1866 |
# Special Characters; RFC 1866 |
$string =~ s/&/&/g; |
$string =~ s/&/&/g; |
Line 895 sub htmlify($;$) { |
|
Line 896 sub htmlify($;$) { |
|
$string =~ s/>/>/g; |
$string =~ s/>/>/g; |
|
|
# get URL's as link .. |
# get URL's as link .. |
$string =~ s`(http|ftp|https)(://[-a-zA-Z0-9%.~:_/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*`<A HREF="$1$2$3">$1$2$3</A>`; |
$string =~ s`(http|ftp|https)(://[-a-zA-Z0-9%.~:_/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*`<A HREF="$1$2$3">$1$2$3</A>`g; # ` |
# get e-mails as link |
# get e-mails as link |
$string =~ s`([-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})`<A HREF="mailto:$1">$1</A>`; |
$string =~ s`([-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})`<A HREF="mailto:$1">$1</A>`g; # ` |
|
|
# get #PR as link .. |
if ($extra) { |
if ($pr && defined($prcgi)) { |
# get PR #'s as link .. |
1 while $string =~ s`\b(pr[:#]?\s*(?:#?\d+[,\s]\s*)*#?)(\d+)\b`$1<A HREF="$prcgi$2">$2</A>`i; |
if (defined($prcgi)) { |
$string =~ s`\b${prcategories}/(\d+)\b`<A HREF="$prcgi$1">$&</A>`igo; |
1 while $string =~ s`\b(pr[:#]?\s*(?:#?\d+[,\s]\s*)*#?)(\d+)\b`$1 . &link($2, sprintf($prcgi, $2))`ie; # ` |
|
$string =~ s`\b${prcategories}/(\d+)\b`&link($&, sprintf($prcgi, $1))`igeo; # ` |
|
} |
|
|
|
# get manpage specs as link .. |
|
if (defined($mancgi)) { |
|
$string =~ s`\b([a-zA-Z]\w+)\(([0-9n])\)\B`&link($&, sprintf($mancgi, $2, $1))`ge; # ` |
|
} |
} |
} |
|
|
return $string; |
return $string; |
} |
} |
|
|
sub spacedHtmlText($) { |
sub spacedHtmlText($;$) { |
local $_ = $_[0]; |
local $_ = $_[0]; |
|
my $ts = $_[1] || $tabstop; |
|
|
# Cut trailing spaces |
# Cut trailing spaces and tabs |
s/\s+\n$//; |
s/[ \t]+$//; |
|
|
# Expand tabs |
if (defined($tabstop)) { |
s/\t+/' ' x (length($&) * $tabstop - length($`) % $tabstop)/e |
# Expand tabs |
if (defined($tabstop)); |
1 while s/\t+/' ' x (length($&) * $ts - length($`) % $ts)/e |
|
} |
|
|
# replace <tab> and <space> (\001 is to protect us from htmlify) |
# replace <tab> and <space> (\001 is to protect us from htmlify) |
# gzip can make excellent use of this repeating pattern :-) |
# gzip can make excellent use of this repeating pattern :-) |
s/\001/\001%/g; #protect our & substitute |
|
if ($hr_breakable) { |
if ($hr_breakable) { |
# make every other space 'breakable' |
# make every other space 'breakable' |
s/ / \001nbsp; \001nbsp; \001nbsp; \001nbsp;/g; # <tab> |
|
s/ / \001nbsp;/g; # 2 * <space> |
s/ / \001nbsp;/g; # 2 * <space> |
# leave single space as it is |
# leave single space as it is |
} |
} else { |
else { |
|
s/ /\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;\001nbsp;/g; |
|
s/ /\001nbsp;/g; |
s/ /\001nbsp;/g; |
} |
} |
|
|
$_ = htmlify($_); |
$_ = htmlify($_); |
|
|
# unescape |
# unescape |
s/\001([^%])/&$1/g; |
y/\001/&/; |
s/\001%/\001/g; |
|
|
|
return $_; |
return $_; |
} |
} |
|
|
|
|
sub revcmp($$) { |
sub revcmp($$) { |
my($rev1, $rev2) = @_; |
my($rev1, $rev2) = @_; |
|
|
|
# make no comparison for a tag or a branch |
|
return 0 if $rev1 =~ /[^\d.]/ || $rev2 =~ /[^\d.]/; |
|
|
my(@r1) = split(/\./, $rev1); |
my(@r1) = split(/\./, $rev1); |
my(@r2) = split(/\./, $rev2); |
my(@r2) = split(/\./, $rev2); |
my($a,$b); |
my($a,$b); |
Line 1063 sub doAnnotate($$) { |
|
Line 1072 sub doAnnotate($$) { |
|
|
|
# make sure the revisions a wellformed, for security |
# make sure the revisions a wellformed, for security |
# reasons .. |
# reasons .. |
if (!($rev =~ /^[\d\.]+$/)) { |
if ($rev =~ /[^\w.]/) { |
&fatal("404 Not Found", |
&fatal("404 Not Found", |
"Malformed query \"$ENV{QUERY_STRING}\""); |
"Malformed query \"$ENV{QUERY_STRING}\""); |
} |
} |
Line 1170 sub doAnnotate($$) { |
|
Line 1179 sub doAnnotate($$) { |
|
} |
} |
else { |
else { |
$revprint = $lrev; $oldLusr = ""; |
$revprint = $lrev; $oldLusr = ""; |
|
$revprint =~ s`^(\S+)`<a href="${scriptwhere}${barequery}#rev$1">$1</A>`; # ` |
} |
} |
if ($lusr eq $oldLusr) { |
if ($lusr eq $oldLusr) { |
$usrprint = " "; |
$usrprint = " "; |
Line 1214 sub doCheckout($$) { |
|
Line 1224 sub doCheckout($$) { |
|
my ($mimetype,$revopt); |
my ($mimetype,$revopt); |
my $fh = do {local(*FH);}; |
my $fh = do {local(*FH);}; |
|
|
|
if ($rev eq 'HEAD' || $rev eq '.') { |
|
$rev = undef; |
|
} |
|
|
# make sure the revisions a wellformed, for security |
# make sure the revisions a wellformed, for security |
# reasons .. |
# reasons .. |
if (defined($rev) && !($rev =~ /^[\d\.]+$/)) { |
if (defined($rev) && $rev =~ /[^\w.]/) { |
&fatal("404 Not Found", |
&fatal("404 Not Found", |
"Malformed query \"$ENV{QUERY_STRING}\""); |
"Malformed query \"$ENV{QUERY_STRING}\""); |
} |
} |
Line 1252 sub doCheckout($$) { |
|
Line 1266 sub doCheckout($$) { |
|
# Safely for a child process to read from. |
# Safely for a child process to read from. |
if (! open($fh, "-|")) { # child |
if (! open($fh, "-|")) { # child |
open(STDERR, ">&STDOUT"); # Redirect stderr to stdout |
open(STDERR, ">&STDOUT"); # Redirect stderr to stdout |
exec("cvs", "-d", $cvsroot, "co", "-p", $revopt, $where); |
exec("cvs", "-Rld", $cvsroot, "co", "-p", $revopt, $where); |
} |
} |
#=================================================================== |
#=================================================================== |
#Checking out squid/src/ftp.c |
#Checking out squid/src/ftp.c |
Line 1369 sub doDiff($$$$$$) { |
|
Line 1383 sub doDiff($$$$$$) { |
|
$rev2 = $tr2; |
$rev2 = $tr2; |
$sym2 = ""; |
$sym2 = ""; |
} |
} |
|
|
# make sure the revisions a wellformed, for security |
# make sure the revisions a wellformed, for security |
# reasons .. |
# reasons .. |
if (!($rev1 =~ /^[\d\.]+$/) || !($rev2 =~ /^[\d\.]+$/)) { |
if ($rev1 =~ /[^\w.]/ || $rev2 =~ /[^\w.]/) { |
&fatal("404 Not Found", |
&fatal("404 Not Found", |
"Malformed query \"$ENV{QUERY_STRING}\""); |
"Malformed query \"$ENV{QUERY_STRING}\""); |
} |
} |
Line 1413 sub doDiff($$$$$$) { |
|
Line 1428 sub doDiff($$$$$$) { |
|
|
|
# apply special options |
# apply special options |
if ($showfunc) { |
if ($showfunc) { |
push @difftype, '-p'; |
push @difftype, '-p' if $f =~ /^[cHhu]$/; |
|
|
my($re1, $re2); |
my($re1, $re2); |
|
|
|
|
if (defined($input{$_}) |
if (defined($input{$_}) |
&& ($input{$_} ne $DEFAULTVALUE{$_} && $input{$_} ne "")); |
&& ($input{$_} ne $DEFAULTVALUE{$_} && $input{$_} ne "")); |
} |
} |
print "Diffs between \n"; |
print "<TABLE><TR>\n"; |
|
print "<TD align=right>Diffs between \n"; |
print "<SELECT NAME=\"r1\">\n"; |
print "<SELECT NAME=\"r1\">\n"; |
print "<OPTION VALUE=\"text\" SELECTED>Use Text Field\n"; |
print "<OPTION VALUE=\"text\" SELECTED>Use Text Field\n"; |
print $sel; |
print $sel; |
print "</SELECT>\n"; |
print "</SELECT>\n"; |
$diffrev = $revdisplayorder[$#revdisplayorder]; |
$diffrev = $revdisplayorder[$#revdisplayorder]; |
$diffrev = $input{"r1"} if (defined($input{"r1"})); |
$diffrev = $input{"r1"} if (defined($input{"r1"})); |
print "<INPUT TYPE=\"TEXT\" SIZE=\"$inputTextSize\" NAME=\"tr1\" VALUE=\"$diffrev\" onChange='document.diff_select.r1.selectedIndex=0'>\n"; |
print "<INPUT TYPE=\"TEXT\" SIZE=\"$inputTextSize\" NAME=\"tr1\" VALUE=\"$diffrev\" onChange='document.diff_select.r1.selectedIndex=0'></TD>"; |
print " and \n"; |
print "<TD><BR></TD></TR>\n"; |
|
print "<TR><TD align=right>and \n"; |
print "<SELECT NAME=\"r2\">\n"; |
print "<SELECT NAME=\"r2\">\n"; |
print "<OPTION VALUE=\"text\" SELECTED>Use Text Field\n"; |
print "<OPTION VALUE=\"text\" SELECTED>Use Text Field\n"; |
print $sel; |
print $sel; |
print "</SELECT>\n"; |
print "</SELECT>\n"; |
$diffrev = $revdisplayorder[0]; |
$diffrev = $revdisplayorder[0]; |
$diffrev = $input{"r2"} if (defined($input{"r2"})); |
$diffrev = $input{"r2"} if (defined($input{"r2"})); |
print "<INPUT TYPE=\"TEXT\" SIZE=\"$inputTextSize\" NAME=\"tr2\" VALUE=\"$diffrev\" onChange='document.diff_select.r2.selectedIndex=0'>\n"; |
print "<INPUT TYPE=\"TEXT\" SIZE=\"$inputTextSize\" NAME=\"tr2\" VALUE=\"$diffrev\" onChange='document.diff_select.r2.selectedIndex=0'></TD>"; |
print "<BR>Type of Diff should be a "; |
print "<TD><INPUT TYPE=SUBMIT VALUE=\" Get Diffs \"></TD>\n"; |
printDiffSelect(0); |
|
print "<INPUT TYPE=SUBMIT VALUE=\" Get Diffs \">\n"; |
|
print "</FORM>\n"; |
print "</FORM>\n"; |
|
print "</TR></TABLE>\n"; |
print "<HR noshade>\n"; |
print "<HR noshade>\n"; |
|
print "<TABLE>"; |
|
print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n"; |
|
print "<TR><TD align=right>Preferred Diff type:</TD>"; |
|
print "<TD>"; |
|
printDiffSelect($use_java_script); |
|
print "</TD><TD></TD></TR>\n"; |
if (@branchnames) { |
if (@branchnames) { |
|
print "<TR><TD align=right>View only Branch:</TD>"; |
|
print "<TD>"; |
print "<A name=branch></A>\n"; |
print "<A name=branch></A>\n"; |
print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n"; |
|
foreach (@stickyvars) { |
|
next if ($_ eq "only_with_tag"); |
|
next if ($_ eq "logsort"); |
|
print "<INPUT TYPE=HIDDEN NAME=\"$_\" VALUE=\"$input{$_}\">\n" |
|
if (defined($input{$_}) && $input{$_} ne $DEFAULTVALUE{$_} |
|
&& $input{$_} ne ""); |
|
} |
|
print "View only Branch: \n"; |
|
print "<SELECT NAME=\"only_with_tag\""; |
print "<SELECT NAME=\"only_with_tag\""; |
print " onchange=\"submit()\"" if ($use_java_script); |
print " onchange=\"submit()\"" if ($use_java_script); |
print ">\n"; |
print ">\n"; |
|
|
&& $input{"only_with_tag"} eq $_); |
&& $input{"only_with_tag"} eq $_); |
print ">${_}\n"; |
print ">${_}\n"; |
} |
} |
print "</SELECT>\n"; |
print "</SELECT></TD><TD></TD></TR>\n"; |
print "<INPUT TYPE=SUBMIT VALUE=\" View Branch \">\n"; |
|
print "</FORM>\n"; |
|
} |
} |
print "<A name=logsort></A>\n"; |
|
print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n"; |
|
foreach (@stickyvars) { |
foreach (@stickyvars) { |
|
next if ($_ eq "f"); |
next if ($_ eq "only_with_tag"); |
next if ($_ eq "only_with_tag"); |
next if ($_ eq "logsort"); |
next if ($_ eq "logsort"); |
print "<INPUT TYPE=HIDDEN NAME=\"$_\" VALUE=\"$input{$_}\">\n" |
print "<INPUT TYPE=HIDDEN NAME=\"$_\" VALUE=\"$input{$_}\">\n" |
if (defined($input{$_}) && $input{$_} ne $DEFAULTVALUE{$_} |
if (defined($input{$_}) && $input{$_} ne $DEFAULTVALUE{$_} |
&& $input{$_} ne ""); |
&& $input{$_} ne ""); |
} |
} |
print "Sort log by: \n"; |
print "<TR><TD align=right>"; |
print "<SELECT NAME=\"logsort\""; |
print "<A name=logsort></A>\n"; |
|
print "Sort log by:</TD>"; |
|
print "<TD><SELECT NAME=\"logsort\""; |
print " onchange=\"submit()\"" if ($use_java_script); |
print " onchange=\"submit()\"" if ($use_java_script); |
print ">\n"; |
print ">\n"; |
print "<OPTION VALUE=cvs",$logsort eq "cvs" ? " SELECTED" : "", ">Not sorted"; |
print "<OPTION VALUE=cvs",$logsort eq "cvs" ? " SELECTED" : "", ">Not sorted"; |
print "<OPTION VALUE=date",$logsort eq "date" ? " SELECTED" : "", ">Commit date"; |
print "<OPTION VALUE=date",$logsort eq "date" ? " SELECTED" : "", ">Commit date"; |
print "<OPTION VALUE=rev",$logsort eq "rev" ? " SELECTED" : "", ">Revision"; |
print "<OPTION VALUE=rev",$logsort eq "rev" ? " SELECTED" : "", ">Revision"; |
print "</SELECT>\n"; |
print "</SELECT></TD>"; |
print "<INPUT TYPE=SUBMIT VALUE=\" Sort \">\n"; |
print "<TD><INPUT TYPE=SUBMIT VALUE=\" Set \"></TD>"; |
print "</FORM>\n"; |
print "</FORM>\n"; |
|
print "</TR></TABLE>"; |
print &html_footer; |
print &html_footer; |
print "</BODY></HTML>\n"; |
print "</BODY></HTML>\n"; |
} |
} |