version 3.36, 2000/10/20 12:28:45 |
version 3.37, 2000/10/20 15:46:01 |
|
|
use vars qw ( |
use vars qw ( |
$config $allow_version_select $verbose |
$config $allow_version_select $verbose |
%CVSROOT %CVSROOTdescr %MIRRORS %DEFAULTVALUE %ICONS %MTYPES |
%CVSROOT %CVSROOTdescr %MIRRORS %DEFAULTVALUE %ICONS %MTYPES |
|
@DIFFTYPES %DIFFTYPES @LOGSORTKEYS %LOGSORTKEYS |
%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 |
@revisions %state %difflines %log %branchpoint @revorder |
|
|
%funcline_regexp $is_mod_perl |
%funcline_regexp $is_mod_perl |
$is_links $is_lynx $is_w3m $is_msie $is_mozilla3 $is_textbased |
$is_links $is_lynx $is_w3m $is_msie $is_mozilla3 $is_textbased |
%input $query $barequery $sortby $bydate $byrev $byauthor |
%input $query $barequery $sortby $bydate $byrev $byauthor |
$bylog $byfile $hr_default $logsort $cvstree $cvsroot |
$bylog $byfile $defaultDiffType $logsort $cvstree $cvsroot |
$mimetype $defaultTextPlain $defaultViewable $allow_compress |
$mimetype $defaultTextPlain $defaultViewable $allow_compress |
$GZIPBIN $backicon $diricon $fileicon $fullname $newname |
$GZIPBIN $backicon $diricon $fileicon $fullname $newname |
$cvstreedefault $body_tag $body_tag_for_src |
$cvstreedefault $body_tag $body_tag_for_src |
|
|
); |
); |
|
|
sub printDiffSelect($); |
sub printDiffSelect($); |
|
sub printDiffLinks($$); |
|
sub printLogSortSelect($); |
sub findLastModifiedSubdirs(@); |
sub findLastModifiedSubdirs(@); |
sub htmlify_sub(&$); |
sub htmlify_sub(&$); |
sub htmlify($;$); |
sub htmlify($;$); |
Line 166 $tabstop = $use_moddate = $moddate = $gzip_open = unde |
|
Line 169 $tabstop = $use_moddate = $moddate = $gzip_open = unde |
|
$LOG_FILESEPARATOR = q/^={77}$/; |
$LOG_FILESEPARATOR = q/^={77}$/; |
$LOG_REVSEPARATOR = q/^-{28}$/; |
$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 ##### |
##### End of configuration variables ##### |
|
|
use Time::Local; |
use Time::Local; |
|
|
$byfile = 1; |
$byfile = 1; |
} |
} |
|
|
$hr_default = ($input{'f'} eq 'h' || $input{'f'} eq 'H'); |
$defaultDiffType = $input{'f'}; |
|
|
$logsort = $input{'logsort'}; |
$logsort = $input{'logsort'}; |
|
|
Line 785 elsif (-d $fullname) { |
|
Line 831 elsif (-d $fullname) { |
|
print "<OPTION",$byrev ? " SELECTED" : ""," VALUE=rev>Revision"; |
print "<OPTION",$byrev ? " SELECTED" : ""," VALUE=rev>Revision"; |
print "<OPTION",$bylog ? " SELECTED" : ""," VALUE=log>Log message"; |
print "<OPTION",$bylog ? " SELECTED" : ""," VALUE=log>Log message"; |
print "</SELECT></td>"; |
print "</SELECT></td>"; |
print "<td>revisions by: \n"; |
print "<td>Sort log by: "; |
print "<SELECT NAME=logsort>\n"; |
printLogSortSelect(0); |
print "<OPTION VALUE=cvs",$logsort eq "cvs" ? " SELECTED" : "", ">Not sorted"; |
print "</td></tr>"; |
print "<OPTION VALUE=date",$logsort eq "date" ? " SELECTED" : "", ">Commit date"; |
|
print "<OPTION VALUE=rev",$logsort eq "rev" ? " SELECTED" : "", ">Revision"; |
|
print "</SELECT></td></tr>"; |
|
print "<tr><td>Diff format: "; |
print "<tr><td>Diff format: "; |
printDiffSelect(0); |
printDiffSelect(0); |
print "</td>"; |
print "</td>"; |
|
|
|
|
sub printDiffSelect($) { |
sub printDiffSelect($) { |
my ($use_java_script) = @_; |
my ($use_java_script) = @_; |
my ($f) = $input{'f'}; |
my $f = $input{'f'}; |
print "<SELECT NAME=\"f\""; |
|
print " onchange=\"submit()\"" if ($use_java_script); |
print '<SELECT NAME="f"'; |
print ">\n"; |
print ' onchange="submit()"' if $use_java_script; |
print "<OPTION VALUE=h",$f eq "h" ? " SELECTED" : "", ">Colored Diff"; |
print '>'; |
print "<OPTION VALUE=H",$f eq "H" ? " SELECTED" : "", ">Long Colored Diff"; |
|
print "<OPTION VALUE=u",$f eq "u" ? " SELECTED" : "", ">Unidiff"; |
local $_; |
print "<OPTION VALUE=c",$f eq "c" ? " SELECTED" : "", ">Context Diff"; |
for (@DIFFTYPES) { |
print "<OPTION VALUE=s",$f eq "s" ? " SELECTED" : "", ">Side by Side"; |
printf('<OPTION VALUE="%s"%s>%s', |
|
$_, |
|
$f eq $_ ? ' SELECTED' : '', |
|
"\u$DIFFTYPES{$_}{'descr'}" |
|
); |
|
} |
|
|
print "</SELECT>"; |
print "</SELECT>"; |
} |
} |
|
|
|
sub printLogSortSelect($) { |
|
my ($use_java_script) = @_; |
|
|
|
print '<SELECT NAME="logsort"'; |
|
print ' onchange="submit()"' if $use_java_script; |
|
print '>'; |
|
|
|
local $_; |
|
for (@LOGSORTKEYS) { |
|
printf('<OPTION VALUE="%s"%s>%s', |
|
$_, |
|
$logsort eq $_ ? ' SELECTED' : '', |
|
"\u$LOGSORTKEYS{$_}{'descr'}" |
|
); |
|
} |
|
|
|
print "</SELECT>"; |
|
} |
|
|
sub findLastModifiedSubdirs(@) { |
sub findLastModifiedSubdirs(@) { |
my (@dirs) = @_; |
my (@dirs) = @_; |
my ($dirname, @files); |
my ($dirname, @files); |
Line 1529 sub viewable($) { |
|
Line 1597 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, $f1, $f2); |
|
|
if ($r1 =~ /([^:]+)(:(.+))?/) { |
if ($r1 =~ /([^:]+)(:(.+))?/) { |
$rev1 = $1; |
$rev1 = $1; |
Line 1563 sub doDiff($$$$$$) { |
|
Line 1631 sub doDiff($$$$$$) { |
|
($rev1, $sym1) = ($rev2, $sym2); |
($rev1, $sym1) = ($rev2, $sym2); |
($rev2, $sym2) = ($tmp1, $tmp2); |
($rev2, $sym2) = ($tmp1, $tmp2); |
} |
} |
my $human_readable = 0; |
my $difftype = $DIFFTYPES{$f}; |
if ($f eq 'c') { |
|
@difftype = qw{-c}; |
if (!$difftype) { |
$diffname = "Context diff"; |
|
} |
|
elsif ($f eq 's') { |
|
@difftype = qw{--side-by-side --width=164}; |
|
$diffname = "Side by Side"; |
|
} |
|
elsif ($f eq 'H') { |
|
$human_readable = 1; |
|
@difftype = qw{--unified=15}; |
|
$diffname = "Long Human readable"; |
|
} |
|
elsif ($f eq 'h') { |
|
@difftype =qw{-u}; |
|
$human_readable = 1; |
|
$diffname = "Human readable"; |
|
} |
|
elsif ($f eq 'u') { |
|
@difftype = qw{-u}; |
|
$diffname = "Unidiff"; |
|
} |
|
else { |
|
fatal ("400 Bad arguments", "Diff format $f not understood"); |
fatal ("400 Bad arguments", "Diff format $f not understood"); |
} |
} |
|
|
|
my @difftype = @{$difftype->{'opts'}}; |
|
my $human_readable = $difftype->{'colored'}; |
|
|
# apply special options |
# apply special options |
if ($showfunc) { |
if ($showfunc) { |
push @difftype, '-p' if $f =~ /^[cHhu]$/; |
push @difftype, '-p' if $f ne 's'; |
|
|
my($re1, $re2); |
my($re1, $re2); |
|
|
Line 2066 sub readLog($;$) { |
|
Line 2116 sub readLog($;$) { |
|
|
|
} |
} |
|
|
|
sub printDiffLinks($$) { |
|
my($text, $url) = @_; |
|
my @extra; |
|
|
|
local $_; |
|
for ($DIFFTYPES{$defaultDiffType}{'colored'} ? qw(u) : qw(h)) { |
|
my $f = $_ eq $defaultDiffType ? '' : $_; |
|
|
|
push @extra, &link(lc $DIFFTYPES{$_}{'descr'}, "$url&f=$f"); |
|
} |
|
|
|
print &link($text, $url), ' (', join(', ', @extra), ')'; |
|
} |
|
|
sub printLog($;$) { |
sub printLog($;$) { |
my ($link, $br, $brp); |
my ($link, $br, $brp); |
($_,$link) = @_; |
($_,$link) = @_; |
Line 2190 sub printLog($;$) { |
|
Line 2254 sub printLog($;$) { |
|
$barequery); |
$barequery); |
|
|
print " to previous "; |
print " to previous "; |
print &link($prev, $url); |
printDiffLinks($prev, $url); |
if (!$hr_default) { # offer a human readable version if not default |
|
print ' (', &link('colored', "$url&f=h"), ')'; |
|
} |
|
} |
} |
# |
# |
# Plus, if it's on a branch, and it's not a vendor branch, |
# Plus, if it's on a branch, and it's not a vendor branch, |
Line 2206 sub printLog($;$) { |
|
Line 2267 sub printLog($;$) { |
|
$barequery); |
$barequery); |
|
|
print " to branchpoint "; |
print " to branchpoint "; |
print &link($brp, $url); |
printDiffLinks($brp, $url); |
if (!$hr_default) { # offer a human readable version if not default |
|
print ' (', &link('colored', "$url&f=h"), ')'; |
|
} |
|
} |
} |
# |
# |
# Plus, if it's on a branch, and it's not a vendor branch, |
# Plus, if it's on a branch, and it's not a vendor branch, |
Line 2242 sub printLog($;$) { |
|
Line 2300 sub printLog($;$) { |
|
$barequery); |
$barequery); |
|
|
print " next main "; |
print " next main "; |
print &link($nextmain, $url); |
printDiffLinks($nextmain, $url); |
if (!$hr_default) { # offer a human readable version if not default |
|
print ' (', &link('colored', "$url&f=h"), ')'; |
|
} |
|
} |
} |
} |
} |
# Plus if user has selected only r1, then present a link |
# Plus if user has selected only r1, then present a link |
Line 2260 sub printLog($;$) { |
|
Line 2315 sub printLog($;$) { |
|
$barequery); |
$barequery); |
|
|
print " to selected "; |
print " to selected "; |
print &link($input{'r1'}, $url); |
printDiffLinks($input{'r1'}, $url); |
if (!$hr_default) { # offer a human readable version if not default |
|
print ' (', &link('colored', "$url&f=h"), ')'; |
|
} |
|
} |
} |
} |
} |
print "<PRE>\n"; |
print "<PRE>\n"; |
|
|
print "<HR noshade>\n"; |
print "<HR noshade>\n"; |
print "<TABLE>"; |
print "<TABLE>"; |
print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n"; |
print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n"; |
print "<TR><TD align=right>Preferred Diff type:</TD>"; |
print "<TR><TD align=right>Preferred Diff type:</TD>"; |
print "<TD>"; |
print "<TD>"; |
printDiffSelect($use_java_script); |
printDiffSelect($use_java_script); |
print "</TD><TD></TD></TR>\n"; |
print "</TD><TD></TD></TR>\n"; |
if (@branchnames) { |
if (@branchnames) { |
|
|
print "<TR><TD align=right>"; |
print "<TR><TD align=right>"; |
print "<A name=logsort></A>\n"; |
print "<A name=logsort></A>\n"; |
print "Sort log by:</TD>"; |
print "Sort log by:</TD>"; |
print "<TD><SELECT NAME=\"logsort\""; |
print "<TD>"; |
print " onchange=\"submit()\"" if ($use_java_script); |
printLogSortSelect($use_java_script); |
print ">\n"; |
print "</TD>"; |
print "<OPTION VALUE=cvs",$logsort eq "cvs" ? " SELECTED" : "", ">Not sorted"; |
|
print "<OPTION VALUE=date",$logsort eq "date" ? " SELECTED" : "", ">Commit date"; |
|
print "<OPTION VALUE=rev",$logsort eq "rev" ? " SELECTED" : "", ">Revision"; |
|
print "</SELECT></TD>"; |
|
print "<TD><INPUT TYPE=SUBMIT VALUE=\" Set \"></TD>"; |
print "<TD><INPUT TYPE=SUBMIT VALUE=\" Set \"></TD>"; |
print "</FORM>\n"; |
print "</FORM>\n"; |
print "</TR></TABLE>"; |
print "</TR></TABLE>"; |