2006-01-13 16:57:25 +00:00
|
|
|
#!/usr/bin/perl -w
|
1999-07-23 18:39:31 +00:00
|
|
|
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
1998-06-16 21:43:24 +00:00
|
|
|
#
|
1999-11-01 23:33:56 +00:00
|
|
|
# The contents of this file are subject to the Netscape Public
|
|
|
|
# License Version 1.1 (the "License"); you may not use this file
|
|
|
|
# except in compliance with the License. You may obtain a copy of
|
|
|
|
# the License at http://www.mozilla.org/NPL/
|
1998-06-16 21:43:24 +00:00
|
|
|
#
|
1999-11-01 23:33:56 +00:00
|
|
|
# Software distributed under the License is distributed on an "AS
|
|
|
|
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
# implied. See the License for the specific language governing
|
|
|
|
# rights and limitations under the License.
|
1998-06-16 21:43:24 +00:00
|
|
|
#
|
|
|
|
# The Original Code is the Bonsai CVS tool.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is Netscape Communications
|
1999-11-01 23:33:56 +00:00
|
|
|
# Corporation. Portions created by Netscape are
|
|
|
|
# Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
# Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-10-18 22:55:01 +00:00
|
|
|
use strict;
|
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
require 'CGI.pl';
|
|
|
|
use vars qw(@TreeList);
|
|
|
|
|
|
|
|
print "Content-type: text/html\n\n";
|
|
|
|
|
|
|
|
Lock();
|
|
|
|
LoadCheckins();
|
|
|
|
LoadTreeConfig();
|
|
|
|
Unlock();
|
|
|
|
|
|
|
|
my %peoplearray = ();
|
|
|
|
my @list = ();
|
|
|
|
my $versioninfo = '';
|
|
|
|
my $tweak = $::FORM{'tweak'};
|
|
|
|
my $delta_size = 1;
|
|
|
|
my ($title, $head, $subhead) = ('', '', '');
|
|
|
|
my ($checkin, $info);
|
|
|
|
|
|
|
|
sub BreakBig {
|
|
|
|
my ($str) = @_;
|
|
|
|
my $result = '';
|
|
|
|
|
|
|
|
while (length($str) > 20) {
|
|
|
|
my $head = substr($str, 0, 19);
|
|
|
|
my $w = rindex($head, "/");
|
|
|
|
|
|
|
|
$w = 19 if ($w < 0);
|
|
|
|
$result .= substr($str, 0, $w++) . "<br>";
|
|
|
|
$str = substr($str, $w);
|
|
|
|
}
|
|
|
|
return $result . $str;
|
1998-06-16 21:43:24 +00:00
|
|
|
}
|
|
|
|
|
2004-12-01 04:25:22 +00:00
|
|
|
my $person = &SanitizeUsernames($::FORM{'person'});
|
|
|
|
if ($person) {
|
|
|
|
my $escaped_person = &html_quote($person);
|
2002-08-28 21:03:26 +00:00
|
|
|
$title = $head = "Checkins for $escaped_person";
|
1999-07-23 18:39:31 +00:00
|
|
|
|
|
|
|
foreach $checkin (@::CheckInList) {
|
|
|
|
$info = eval("\\\%$checkin");
|
|
|
|
push @list, $checkin
|
2004-12-01 04:25:22 +00:00
|
|
|
if ($$info{'person'} eq $person);
|
1999-07-23 18:39:31 +00:00
|
|
|
}
|
|
|
|
} elsif (exists($::FORM{'mindate'}) || exists($::FORM{'maxdate'})) {
|
|
|
|
my ($min, $max) = (0, 1<<30);
|
|
|
|
|
|
|
|
$title = "Checkins";
|
2004-12-01 04:25:22 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
if (exists($::FORM{'mindate'})) {
|
2004-12-01 04:25:22 +00:00
|
|
|
$title .= " since " .
|
|
|
|
&MyFmtClock($min = &ExpectDate($::FORM{'mindate}'}));
|
|
|
|
$title .= " and" if (exists($::FORM{'maxdate'}));
|
1999-07-23 18:39:31 +00:00
|
|
|
}
|
2004-12-01 04:25:22 +00:00
|
|
|
$title .= " before" . &MyFmtClock($max = &ExpectDate($::FORM{'maxdate'}))
|
|
|
|
if (exists($::FORM{'maxdate'}));
|
1999-07-23 18:39:31 +00:00
|
|
|
$head = $title;
|
|
|
|
|
|
|
|
foreach $checkin (@::CheckInList) {
|
|
|
|
$info = eval("\\\%$checkin");
|
|
|
|
push @list, $checkin
|
|
|
|
if (($$info{'date'} >= $min) && ($$info{'date'} <= $max));
|
|
|
|
}
|
1998-06-16 21:43:24 +00:00
|
|
|
} else {
|
1999-07-23 18:39:31 +00:00
|
|
|
$title = $head = "All Checkins";
|
|
|
|
@list = @::CheckInList;
|
1998-06-16 21:43:24 +00:00
|
|
|
}
|
|
|
|
|
2002-10-09 19:23:11 +00:00
|
|
|
my $treepart = '';
|
|
|
|
$treepart = "&treeid=$::TreeID" if ($::TreeID ne "default");
|
|
|
|
my $branchpart = '';
|
|
|
|
$branchpart = "&branch=$::TreeInfo{$::TreeID}{branch}"
|
|
|
|
if ($::TreeInfo{$::TreeID}{branch});
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
$subhead .= "<br><font color=red>
|
2002-10-09 19:23:11 +00:00
|
|
|
These checkins are <em>not</em> from <a
|
|
|
|
href='showcheckins.cgi?$treepart$branchpart'>the current
|
|
|
|
hook</a>!</font><br>"
|
1999-07-23 18:39:31 +00:00
|
|
|
if (Param('readonly'));
|
2002-10-09 19:23:11 +00:00
|
|
|
$subhead .= "View a <a href=\"viewold.cgi?" . BatchIdPart('?') . "&target=showcheckins\">different
|
|
|
|
day's checkins</a>.<br>";
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
PutsHeader($title, $head, $subhead);
|
1998-06-16 21:43:24 +00:00
|
|
|
|
2004-12-01 04:25:22 +00:00
|
|
|
my $sort = $::FORM{'sort'} || "";
|
|
|
|
if (!$sort) {
|
|
|
|
$sort = 'date';
|
|
|
|
} else {
|
|
|
|
die ("Invalid sort string.\n") unless ($sort =~ m/^\w+(,\w+)*$/);
|
|
|
|
}
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
print "
|
2004-12-01 04:25:22 +00:00
|
|
|
(Current sort is by <tt>$sort</tt>; click on a column header
|
1999-07-23 18:39:31 +00:00
|
|
|
to sort by that column.)";
|
1998-06-16 21:43:24 +00:00
|
|
|
|
2004-12-01 04:25:22 +00:00
|
|
|
my @fields = split(/,/, $sort);
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
sub Compare {
|
|
|
|
my $rval = 0;
|
|
|
|
my $key;
|
1999-10-18 23:32:03 +00:00
|
|
|
my $aref = eval("\\\%$a");
|
|
|
|
my $bref = eval("\\\%$b");
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
foreach $key (@fields) {
|
1999-07-26 19:06:26 +00:00
|
|
|
if ($key eq 'date') {
|
1999-10-18 23:32:03 +00:00
|
|
|
$rval = $$bref{$key} cmp $$aref{$key};
|
1999-07-26 19:06:26 +00:00
|
|
|
} else {
|
1999-10-18 23:32:03 +00:00
|
|
|
$rval = $$aref{$key} cmp $$bref{$key};
|
1999-07-26 19:06:26 +00:00
|
|
|
}
|
|
|
|
return $rval unless ($rval == 0);
|
1999-07-23 18:39:31 +00:00
|
|
|
}
|
|
|
|
return $rval;
|
|
|
|
}
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
my $total_added = 0;
|
|
|
|
my $total_removed = 0;
|
1998-06-16 21:43:24 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Calculate delta information
|
|
|
|
#
|
1999-07-23 18:39:31 +00:00
|
|
|
CHECKIN:
|
1999-10-18 22:55:01 +00:00
|
|
|
foreach my $infoname (@list) {
|
|
|
|
$info = eval("\\\%$infoname");
|
1999-07-23 18:39:31 +00:00
|
|
|
$$info{added} = 0;
|
|
|
|
$$info{removed} = 0;
|
|
|
|
|
|
|
|
if (exists($$info{'fullinfo'})) {
|
|
|
|
my @fullinfos = split(/!NeXt!/, $$info{'fullinfo'});
|
|
|
|
INFO:
|
|
|
|
foreach my $fullinfo (@fullinfos) {
|
|
|
|
my ($file, $version, $addlines, $removelines, $sticky)
|
|
|
|
= split(/\|/, $fullinfo);
|
|
|
|
|
|
|
|
# Skip binary files
|
|
|
|
next INFO if (($file =~ /\.gif$/) ||
|
|
|
|
($file =~ /\.bmp$/) ||
|
|
|
|
($sticky =~ /-kb/));
|
|
|
|
|
1999-10-18 23:23:08 +00:00
|
|
|
if ($addlines) {
|
|
|
|
$$info{added} += $addlines;
|
|
|
|
}
|
|
|
|
if ($removelines) {
|
|
|
|
$$info{removed} += $removelines;
|
|
|
|
}
|
1999-07-23 18:39:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$$info{'lines_changed'} =
|
|
|
|
sprintf("%7d", 1000000 - ($$info{added} - $$info{removed}));
|
|
|
|
|
|
|
|
$total_added += $$info{added};
|
|
|
|
$total_removed += $$info{removed};
|
1998-06-16 21:43:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
# Sort that puppy...
|
|
|
|
@list = sort Compare @list;
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
# $::buffer contains the arguments that we were called with, it is
|
|
|
|
# initialized by CGI.pl
|
|
|
|
my $otherparams;
|
|
|
|
($otherparams = $::buffer) =~ s/[&?]sort=[^&]*//g;
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
sub NewSort {
|
|
|
|
my ($key) = @_;
|
2004-12-01 04:25:22 +00:00
|
|
|
my @sort_keys = grep(!/^$key$/, split(/,/, $sort));
|
1999-07-23 18:39:31 +00:00
|
|
|
unshift(@sort_keys, $key);
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
return $otherparams . "&sort=" . join(',', @sort_keys);
|
1998-06-16 21:43:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
#
|
|
|
|
# Print the table...
|
|
|
|
#
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
print "<FORM method=get action=\"dotweak.cgi\">\n" if $tweak;
|
|
|
|
print "<TABLE border cellspacing=2>\n<TR ALIGN=LEFT>\n\n";
|
|
|
|
print "<TH></TH>\n" if $tweak;
|
|
|
|
|
|
|
|
print "
|
|
|
|
<TH><A HREF=\"showcheckins.cgi?${otherparams}&sort=date\">When</A>
|
|
|
|
<TH><A HREF=\"showcheckins.cgi?" . NewSort('treeopen') . "\">Tree state</A>
|
|
|
|
<TH><A HREF=\"showcheckins.cgi?" . NewSort('person') . "\">Who</A>
|
|
|
|
<TH><A HREF=\"showcheckins.cgi?" . NewSort('dir') . "\">Directory</A>
|
|
|
|
<TH><A HREF=\"showcheckins.cgi?" . NewSort('files') . "\">Files</A>
|
|
|
|
<TH><A HREF=\"showcheckins.cgi?" . NewSort('lines_changed') .
|
|
|
|
"\"><tt>+/-</tt></A>
|
1998-06-16 21:43:24 +00:00
|
|
|
<TH WIDTH=100%>Description
|
1999-07-23 18:39:31 +00:00
|
|
|
</TR>\n\n";
|
|
|
|
|
|
|
|
|
|
|
|
my $count = 0;
|
|
|
|
my $maxcount = 100;
|
|
|
|
|
|
|
|
foreach $checkin (@list) {
|
|
|
|
$info = eval("\\\%$checkin");
|
|
|
|
|
|
|
|
# Don't make tables too big, or toy computers will break.
|
|
|
|
if ($count++ > $maxcount) {
|
|
|
|
$count = 0;
|
|
|
|
print "</TABLE>\n\n<TABLE border cellspacing=2>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "<TR>\n";
|
|
|
|
print "<TD><INPUT TYPE=CHECKBOX NAME=\"$checkin\"></TD>\n" if $tweak;
|
|
|
|
print "<TD><a href=editcheckin.cgi?id=$checkin" . BatchIdPart(). ">\n";
|
2004-03-22 18:04:17 +00:00
|
|
|
print time2str("<font size=-1>%Y-%m-%d %H:%M</font>" , $$info{date}) .
|
1999-07-23 18:39:31 +00:00
|
|
|
"</a></TD>\n";
|
|
|
|
print "<TD>" . (($$info{treeopen})? "open": "CLOSED") . "\n";
|
|
|
|
print "<br>$$info{notes}\n" if $$info{notes};
|
|
|
|
|
|
|
|
$peoplearray{$$info{person}} = 1;
|
2004-12-01 01:11:37 +00:00
|
|
|
my @file_list;
|
|
|
|
foreach my $fn (split(/!NeXt!/, $$info{files})) {
|
|
|
|
push @file_list, &url_quote($fn);
|
|
|
|
}
|
1999-07-23 18:39:31 +00:00
|
|
|
print "<TD>". GenerateUserLookUp($$info{person}) . "</TD>\n";
|
|
|
|
print "<TD><a href=\"cvsview2.cgi?" .
|
|
|
|
"root=$::TreeInfo{$::TreeID}{repository}&" .
|
2004-12-01 01:11:37 +00:00
|
|
|
"subdir=" . &url_quote($$info{dir}) .
|
|
|
|
"&files=" . join(':', @file_list) .
|
|
|
|
"&command=DIRECTORY$branchpart\">" .
|
|
|
|
&BreakBig(&html_quote($$info{dir})) .
|
1999-07-23 18:39:31 +00:00
|
|
|
"</a></TD>\n";
|
|
|
|
print "<TD>\n";
|
|
|
|
foreach my $file (split(/!NeXt!/, $$info{files})) {
|
|
|
|
print " <a href=\"cvsview2.cgi?" .
|
|
|
|
"root=$::TreeInfo{$::TreeID}{repository}&" .
|
2004-12-01 01:11:37 +00:00
|
|
|
"subdir=" . &url_quote($$info{dir}) .
|
|
|
|
"&files=" . &url_quote($file) .
|
|
|
|
"&command=DIRECTORY$branchpart\">" .
|
|
|
|
&html_quote($file) . "</a>\n";
|
1999-07-23 18:39:31 +00:00
|
|
|
}
|
|
|
|
print "</td>\n";
|
|
|
|
|
|
|
|
print "<TD><tt>+$$info{added}/-". abs($$info{removed}). "</tt></td>\n";
|
|
|
|
foreach my $fullinfo (split(/!NeXt!/, $$info{'fullinfo'})) {
|
|
|
|
my ($file, $version) = split(/\|/, $fullinfo);
|
1999-08-06 17:06:09 +00:00
|
|
|
$versioninfo .= "$$info{person}|$$info{dir}|$file|$version,";
|
1999-07-23 18:39:31 +00:00
|
|
|
}
|
2004-12-01 04:46:35 +00:00
|
|
|
my $comment = &html_quote($$info{'log'});
|
2003-03-16 15:09:33 +00:00
|
|
|
$comment =~ s/\n/<br>/g;
|
|
|
|
print "<TD WIDTH=100%>$comment</td>\n";
|
1999-07-23 18:39:31 +00:00
|
|
|
print "</tr>\n\n";
|
1998-06-16 21:43:24 +00:00
|
|
|
}
|
1999-07-23 18:39:31 +00:00
|
|
|
print "</table>\n";
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
print scalar @list . " checkins listed.
|
|
|
|
Lines changed <tt>($total_added/$total_removed)</tt>.\n";
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
sub IsSelected {
|
|
|
|
my ($value) = @_;
|
1998-06-16 21:43:24 +00:00
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
return "SELECTED" if ($value eq $::TreeID);
|
|
|
|
return "";
|
1998-06-16 21:43:24 +00:00
|
|
|
}
|
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
if ($tweak) {
|
|
|
|
print "
|
1998-06-16 21:43:24 +00:00
|
|
|
<hr>
|
|
|
|
Check the checkins you wish to affect. Then select one of the below options.
|
|
|
|
And type the magic word. Then click on submit.
|
|
|
|
<P>
|
1999-07-23 18:39:31 +00:00
|
|
|
<INPUT TYPE=HIDDEN NAME=treeid VALUE=$::TreeID>
|
1998-06-16 21:43:24 +00:00
|
|
|
<INPUT TYPE=radio NAME=command VALUE=nuke>Delete these checkins.<BR>
|
|
|
|
<INPUT TYPE=radio NAME=command VALUE=setopen>Set the tree state on these checkins to be <B>Open</B>.<BR>
|
|
|
|
<INPUT TYPE=radio NAME=command VALUE=setclose>Set the tree state on these checkins to be <B>Closed</B>.<BR>
|
|
|
|
<INPUT TYPE=radio NAME=command VALUE=movetree>Move these checkins over to this tree:
|
1999-07-23 18:39:31 +00:00
|
|
|
<SELECT NAME=desttree SIZE=1>\n";
|
|
|
|
|
|
|
|
foreach my $tree (@::TreeList) {
|
|
|
|
print "<OPTION ". IsSelected($tree).
|
|
|
|
" VALUE=$tree>$::TreeInfo{$tree}{description}\n"
|
|
|
|
unless $::TreeInfo{$tree}{nobonsai};
|
|
|
|
}
|
|
|
|
|
|
|
|
print "
|
|
|
|
</SELECT><P>
|
1998-06-16 21:43:24 +00:00
|
|
|
<B>Password:</B><INPUT NAME=password TYPE=password></td>
|
|
|
|
<BR>
|
|
|
|
<INPUT TYPE=SUBMIT VALUE=Submit>
|
1999-07-23 18:39:31 +00:00
|
|
|
</FORM>\n";
|
1998-06-16 21:43:24 +00:00
|
|
|
} else {
|
1999-07-23 18:39:31 +00:00
|
|
|
print "
|
|
|
|
|
|
|
|
<a href=showcheckins.cgi?$::buffer&tweak=1>Tweak some of these checkins.</a>
|
|
|
|
<br><br>
|
|
|
|
<FORM action='multidiff.cgi' method=post>
|
|
|
|
<INPUT TYPE='HIDDEN' name='allchanges' value = '$versioninfo'>
|
|
|
|
<INPUT TYPE=SUBMIT VALUE='Show me ALL the Diffs'>
|
|
|
|
</FORM>\n";
|
1998-06-16 21:43:24 +00:00
|
|
|
}
|
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
if (exists $::FORM{ltabbhack}) {
|
|
|
|
print "<!-- StupidLloydHack " . join(',', sort(keys(%peoplearray))) .
|
|
|
|
" -->\n";
|
|
|
|
print "<!-- LloydHack2 $versioninfo -->\n";
|
1998-06-16 21:43:24 +00:00
|
|
|
}
|
|
|
|
|
1999-07-23 18:39:31 +00:00
|
|
|
PutsTrailer();
|
|
|
|
|
1998-06-16 21:43:24 +00:00
|
|
|
|