2006-01-13 19:57:25 +03:00
|
|
|
#!/usr/bin/perl -w
|
1999-07-23 22:39:31 +04:00
|
|
|
# -*- Mode: perl; indent-tabs-mode: nil -*-
|
1998-06-17 01:43:24 +04:00
|
|
|
#
|
1999-11-02 02:33:56 +03: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-17 01:43:24 +04:00
|
|
|
#
|
1999-11-02 02:33:56 +03: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-17 01:43:24 +04:00
|
|
|
#
|
|
|
|
# The Original Code is the Bonsai CVS tool.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is Netscape Communications
|
1999-11-02 02:33:56 +03:00
|
|
|
# Corporation. Portions created by Netscape are
|
|
|
|
# Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
# Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
require 'CGI.pl';
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
use strict;
|
1998-06-17 01:43:24 +04:00
|
|
|
|
2004-12-01 03:15:22 +03:00
|
|
|
# Shut up misguided -w warnings about "used only once". "use vars" just
|
|
|
|
# doesn't work for me.
|
|
|
|
|
|
|
|
sub sillyness {
|
|
|
|
my $zz;
|
|
|
|
$zz = $::FORM{password};
|
|
|
|
$zz = $::LegalDirs;
|
|
|
|
$zz = $::TreeOpen;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
print "Content-type: text/html
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
<HTML>";
|
1998-06-17 01:43:24 +04:00
|
|
|
|
2004-12-01 03:15:22 +03:00
|
|
|
&validateReferer('admin.cgi');
|
1999-07-23 22:39:31 +04:00
|
|
|
CheckPassword($::FORM{'password'});
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
my $startfrom = ParseTimeAndCheck(FormData('startfrom'));
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
Lock();
|
|
|
|
LoadTreeConfig();
|
2000-04-12 22:44:37 +04:00
|
|
|
LoadDirList();
|
1999-07-23 22:39:31 +04:00
|
|
|
LoadCheckins();
|
|
|
|
@::CheckInList = ();
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
|
|
|
|
$| = 1;
|
|
|
|
|
2000-04-12 22:44:37 +04:00
|
|
|
ConnectToDatabase();
|
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
print "<TITLE> Rebooting, please wait...</TITLE>
|
1998-06-17 01:43:24 +04:00
|
|
|
|
|
|
|
<H1>Recreating the hook</H1>
|
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
<h3>$::TreeInfo{$::TreeID}->{'description'}</h3>
|
1998-06-17 01:43:24 +04:00
|
|
|
|
|
|
|
<p>
|
2000-04-12 22:44:37 +04:00
|
|
|
Searching for first checkin after " . SqlFmtClock($startfrom) . "...<p>\n";
|
|
|
|
|
2004-12-01 03:43:28 +03:00
|
|
|
my $inbranch = $::TreeInfo{$::TreeID}->{'branch'};
|
|
|
|
print "<p> $inbranch <p> \n";
|
2000-04-12 22:44:37 +04:00
|
|
|
|
2004-12-01 11:28:06 +03:00
|
|
|
my $sqlstring = "SELECT type, UNIX_TIMESTAMP(ci_when), people.who, " .
|
|
|
|
"repositories.repository, dirs.dir, files.file, revision, stickytag, " .
|
|
|
|
"branches.branch, addedlines, removedlines, descs.description FROM " .
|
|
|
|
"checkins,people,repositories,dirs,files,branches,descs WHERE " .
|
|
|
|
"people.id=whoid AND repositories.id=repositoryid AND dirs.id=dirid " .
|
|
|
|
"AND files.id=fileid AND branches.id=branchid AND descs.id=descid AND " .
|
|
|
|
"branches.branch=? AND ci_when>=? ORDER BY ci_when;";
|
|
|
|
my @bind_values = ($inbranch, &SqlFmtClock($startfrom));
|
|
|
|
print "<p> " . &html_quote($sqlstring) . " <br>\n";
|
|
|
|
print "With values:<br>\n";
|
|
|
|
foreach my $v (@bind_values) {
|
|
|
|
print "\t" . &html_quote($v) . "<br>\n";
|
|
|
|
}
|
|
|
|
print "<p>\n";
|
|
|
|
&SendSQL($sqlstring, @bind_values);
|
2000-04-12 22:44:37 +04:00
|
|
|
|
|
|
|
my ($change, $date, $who, $repos, $dir, $file, $rev, $sticky, $branch, $linesa, $linesr, $log);
|
|
|
|
my ($lastchange, $lastdate, $lastwho, $lastrepos, $lastdir, $lastrev, $laststicky, $lastbranch, $lastlinesa, $lastlinesr, $lastlog);
|
2004-12-01 03:43:28 +03:00
|
|
|
my ($id, $info, @files, @fullinfo);
|
2000-04-12 22:44:37 +04:00
|
|
|
my ($d, $f, $okdir, $full);
|
|
|
|
my ($r);
|
|
|
|
$lastdate = "";
|
|
|
|
$lastdir = "";
|
|
|
|
@files = ();
|
|
|
|
@fullinfo = ();
|
|
|
|
while (($change, $date, $who, $repos, $dir, $file, $rev, $sticky, $branch, $linesa, $linesr, $log) = FetchSQLData()) {
|
|
|
|
# print "<p>$change $date $who $repos $dir $file $rev $sticky $branch $linesa $linesr $log<p>\n ";
|
|
|
|
if (($date ne $lastdate && $lastdate ne "") || ($dir ne $lastdir && $lastdir ne "")) {
|
|
|
|
|
|
|
|
$okdir = 0;
|
|
|
|
LEGALDIR:
|
|
|
|
foreach $d (sort( grep(!/\*$/, @::LegalDirs))) {
|
|
|
|
if ($lastdir =~ m!^$d\b!) {
|
|
|
|
$okdir = 1;
|
|
|
|
last LEGALDIR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($okdir) {
|
|
|
|
print "<br>";
|
|
|
|
print "$lastchange $lastdate $lastwho $lastrepos <br> $lastdir ";
|
|
|
|
print "<br>";
|
|
|
|
foreach $f (@files) { print "$f ";}
|
|
|
|
print " <br>$lastrev $laststicky $lastbranch $lastlinesa $lastlinesr <br>$lastlog";
|
|
|
|
print "\n<br>--------------------------------------------------------<br>\n";
|
|
|
|
$r++;
|
|
|
|
$id = "::checkin_${lastdate}_$r";
|
|
|
|
push @::CheckInList, $id;
|
|
|
|
|
|
|
|
$info = eval("\\\%$id");
|
|
|
|
%$info = (
|
|
|
|
person => $lastwho,
|
|
|
|
date => $lastdate,
|
|
|
|
dir => $lastdir,
|
|
|
|
files => join('!NeXt!', @files),
|
|
|
|
'log' => MarkUpText(html_quote(trim($lastlog))),
|
|
|
|
treeopen => $::TreeOpen,
|
|
|
|
fullinfo => join('!NeXt!', @fullinfo)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@files = ();
|
|
|
|
@fullinfo = ();
|
1998-06-17 01:43:24 +04:00
|
|
|
}
|
2000-04-12 22:44:37 +04:00
|
|
|
$lastchange = $change;
|
|
|
|
$lastdate = $date;
|
|
|
|
$lastwho = $who;
|
|
|
|
$lastrepos = $repos;
|
|
|
|
$lastdir = $dir;
|
|
|
|
$lastrev = $rev;
|
|
|
|
$laststicky = $sticky;
|
|
|
|
$lastbranch = $branch;
|
|
|
|
$lastlinesa = $linesa;
|
|
|
|
$lastlinesr = $linesr;
|
|
|
|
$lastlog = $log;
|
|
|
|
|
|
|
|
if (!($file=~/Tag:/ || ($file=~/$branch/) && ($branch) )) {
|
|
|
|
push @files, $file;
|
|
|
|
push @fullinfo, "$file|$rev|$linesa|$linesr|";
|
1998-06-17 01:43:24 +04:00
|
|
|
}
|
2000-04-12 22:44:37 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
WriteCheckins();
|
|
|
|
Unlock();
|
1998-06-17 01:43:24 +04:00
|
|
|
|
2000-04-12 22:44:37 +04:00
|
|
|
print "<p>OK, done. \n";
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-07-23 22:39:31 +04:00
|
|
|
PutsTrailer();
|