[BACK]Return to cvsweb.cgi CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / cvsweb

Diff for /cvsweb/cvsweb.cgi between version 1.9 and 1.10

version 1.9, 1997/07/19 00:54:40 version 1.10, 1997/11/14 17:36:47
Line 31  require 'ctime.pl';
Line 31  require 'ctime.pl';
 $hsty_base = "";  $hsty_base = "";
 require 'cgi-style.pl';  require 'cgi-style.pl';
   
 $cvsroot = '/home/ncvs';  %CVSROOT = (
               'freebsd', '/home/ncvs',
               'openbsd', '/home/OpenBSD/cvs',
               'learn', '/c/learncvs',
               );
   
   $cvstreedefault = 'freebsd';
   $cvstree = $cvstreedefault;
   $cvsroot = $CVSROOT{"$cvstree"} || "/home/ncvs";
   
   
 $intro = "  $intro = "
 This is a WWW interface to the FreeBSD CVS tree.  This is a WWW interface to the FreeBSD CVS tree.
 You can browse the file hierarchy by picking directories  You can browse the file hierarchy by picking directories
Line 49  CVS tree, see <A HREF=\"http://www.freebsd.org/~fenner
Line 59  CVS tree, see <A HREF=\"http://www.freebsd.org/~fenner
 the CVSWeb distribution site</A>.  the CVSWeb distribution site</A>.
 <p>  <p>
 Please send any suggestions, comments, etc. to  Please send any suggestions, comments, etc. to
 <A HREF=\"mailto:fenner@freebsd.org\">Bill Fenner &lt;fenner@freebsd.org&gt;</A>  <A HREF=\"mailto:fenner\@freebsd.org\">Bill Fenner &lt;fenner\@freebsd.org&gt;</A>
 ";  ";
 $shortinstr = "  $shortinstr = "
 Click on a directory to enter that directory. Click on a file to display  Click on a directory to enter that directory. Click on a file to display
Line 60  chance to display diffs between revisions. 
Line 70  chance to display diffs between revisions. 
 $verbose = $v;  $verbose = $v;
 ($where = $ENV{'PATH_INFO'}) =~ s|^/||;  ($where = $ENV{'PATH_INFO'}) =~ s|^/||;
 $where =~ s|/$||;  $where =~ s|/$||;
 $fullname = $cvsroot . '/' . $where;  
 ($scriptname = $ENV{'SCRIPT_NAME'}) =~ s|^/?|/|;  ($scriptname = $ENV{'SCRIPT_NAME'}) =~ s|^/?|/|;
 $scriptname =~ s|/$||;  $scriptname =~ s|/$||;
 $scriptwhere = $scriptname . '/' . $where;  $scriptwhere = $scriptname . '/' . $where;
 $scriptwhere =~ s|/$||;  $scriptwhere =~ s|/$||;
   
 if (!-d $cvsroot) {  
         &fatal("500 Internal Error",'$CVSROOT not found!');  
 }  
   
 if ($query = $ENV{'QUERY_STRING'}) {  if ($query = $ENV{'QUERY_STRING'}) {
     foreach (split(/&/, $query)) {      foreach (split(/&/, $query)) {
Line 81  if ($query = $ENV{'QUERY_STRING'}) {
Line 87  if ($query = $ENV{'QUERY_STRING'}) {
     }      }
     $query = "?" . $query;      $query = "?" . $query;
 }  }
   
   
   
   if ($input{'cvsroot'}) {
       if ($CVSROOT{$input{'cvsroot'}}) {
           $cvstree = $input{'cvsroot'};
           $cvsroot = $CVSROOT{"$cvstree"};
       }
   }
   
   $fullname = $cvsroot . '/' . $where;
   if (!-d $cvsroot) {
           &fatal("500 Internal Error",'$CVSROOT not found!');
   }
   
   
 if (-d $fullname) {  if (-d $fullname) {
         opendir(DIR, $fullname) || &fatal("404 Not Found","$where: $!");          opendir(DIR, $fullname) || &fatal("404 Not Found","$where: $!");
         @dir = readdir(DIR);          @dir = readdir(DIR);
Line 344  if (-d $fullname) {
Line 366  if (-d $fullname) {
                 $nameprinted{$br}++;                  $nameprinted{$br}++;
             }              }
             print "\n";              print "\n";
             print "<A HREF=\"$scriptwhere?rev=$_\"><b>$_</b></A>";              print "<A HREF=\"$scriptwhere?rev=$_" .
                   &cvsroot . qq{"><b>$_</b></A>};
             if (/^1\.1\.1\.\d+$/) {              if (/^1\.1\.1\.\d+$/) {
                 print " <i>(vendor branch)</i>";                  print " <i>(vendor branch)</i>";
             }              }
Line 387  if (-d $fullname) {
Line 410  if (-d $fullname) {
             if ($prevrev[$#prevrev] != 0) {              if ($prevrev[$#prevrev] != 0) {
                 $prev = join(".", @prevrev);                  $prev = join(".", @prevrev);
                 print "<BR><A HREF=\"${scriptwhere}.diff?r1=$prev";                  print "<BR><A HREF=\"${scriptwhere}.diff?r1=$prev";
                 print "&r2=$_\">Diffs to $prev</A>\n";                  print "&r2=$_" . &cvsroot . qq{">Diffs to $prev</A>\n};
                 #                  #
                 # 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,
                 # offer to diff with the immediately-preceding commit if it                  # offer to diff with the immediately-preceding commit if it
Line 401  if (-d $fullname) {
Line 424  if (-d $fullname) {
                     @tmp2 = split(/\./, $_);                      @tmp2 = split(/\./, $_);
                     if ($#tmp1 < $#tmp2) {                      if ($#tmp1 < $#tmp2) {
                         print "; <A HREF=\"${scriptwhere}.diff?r1=$revorder[$i+1]";                          print "; <A HREF=\"${scriptwhere}.diff?r1=$revorder[$i+1]";
                         print "&r2=$_\">Diffs to $revorder[$i+1]</A>\n";                          print "&r2=$_" . &cvsroot .
                               qq{">Diffs to $revorder[$i+1]</A>\n};
                     }                      }
                 }                  }
             }              }
Line 419  if (-d $fullname) {
Line 443  if (-d $fullname) {
         print "name using the type-in text box.\n";          print "name using the type-in text box.\n";
         print "</A><P>\n";          print "</A><P>\n";
         print "<FORM METHOD=\"GET\" ACTION=\"${scriptwhere}.diff\">\n";          print "<FORM METHOD=\"GET\" ACTION=\"${scriptwhere}.diff\">\n";
           print qq{<input type=hidden name=cvsroot value=$cvstree>\n}
                if &cvsroot;
         print "Diffs between \n";          print "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";
Line 442  if (-d $fullname) {
Line 468  if (-d $fullname) {
         print "a single branch.\n";          print "a single branch.\n";
         print "</A><P>\n";          print "</A><P>\n";
         print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n";          print "<FORM METHOD=\"GET\" ACTION=\"$scriptwhere\">\n";
           print qq{<input type=hidden name=cvsroot value=$cvstree>\n}
                if &cvsroot;
         print "Branch: \n";          print "Branch: \n";
         print "<SELECT NAME=\"only_on_branch\">\n";          print "<SELECT NAME=\"only_on_branch\">\n";
         print "<OPTION VALUE=\"\"";          print "<OPTION VALUE=\"\"";
Line 703  sub dodiff {
Line 731  sub dodiff {
             print $_;              print $_;
         }          }
         close(RCSDIFF);          close(RCSDIFF);
   }
   
   sub cvsroot {
       return '' if $cvstree eq $cvstreedefault;
       return "&cvsroot=" . $cvstree;
 }  }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

CVSweb