=================================================================== RCS file: /cvs/cvsweb/cvsweb.cgi,v retrieving revision 3.36 retrieving revision 3.37 diff -u -p -r3.36 -r3.37 --- cvsweb/cvsweb.cgi 2000/10/20 12:28:45 3.36 +++ cvsweb/cvsweb.cgi 2000/10/20 15:46:01 3.37 @@ -43,7 +43,7 @@ # SUCH DAMAGE. # # $zId: cvsweb.cgi,v 1.103 2000/09/20 17:02:29 jumager Exp $ -# $Id: cvsweb.cgi,v 3.36 2000/10/20 12:28:45 knu Exp $ +# $Id: cvsweb.cgi,v 3.37 2000/10/20 15:46:01 knu Exp $ # ### @@ -52,6 +52,7 @@ 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 @@ -61,7 +62,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 $hr_default $logsort $cvstree $cvsroot + $bylog $byfile $defaultDiffType $logsort $cvstree $cvsroot $mimetype $defaultTextPlain $defaultViewable $allow_compress $GZIPBIN $backicon $diricon $fileicon $fullname $newname $cvstreedefault $body_tag $body_tag_for_src @@ -83,6 +84,8 @@ use vars qw ( ); sub printDiffSelect($); +sub printDiffLinks($$); +sub printLogSortSelect($); sub findLastModifiedSubdirs(@); sub htmlify_sub(&$); sub htmlify($;$); @@ -166,6 +169,49 @@ $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; @@ -329,7 +375,7 @@ else { $byfile = 1; } -$hr_default = ($input{'f'} eq 'h' || $input{'f'} eq 'H'); +$defaultDiffType = $input{'f'}; $logsort = $input{'logsort'}; @@ -785,12 +831,9 @@ elsif (-d $fullname) { print "Revision"; print "Log message"; print ""; - print "revisions by: \n"; - print ""; + print "Sort log by: "; + printLogSortSelect(0); + print ""; print "Diff format: "; printDiffSelect(0); print ""; @@ -884,18 +927,43 @@ gzipclose(); sub printDiffSelect($) { my ($use_java_script) = @_; - my ($f) = $input{'f'}; - print "'; + + local $_; + for (@DIFFTYPES) { + printf('