--- shiela.pl 2002/12/21 12:38:55 1.26
+++ shiela.pl 2002/12/21 17:02:59 1.27
@@ -1539,9 +1539,34 @@
# fix branch/tag and accumulate information
$It = 'HEAD' if ($It eq '');
+ # manually determine next revision number for removed files
+ # by fetching the whole revision log and extracting the next
+ # number.
+ if ($Io eq 'R' and $Iv eq 'NONE') {
+ my $rcslog ='';
+ if (not $RT->{useserver}) {
+ my $io = new IO::File "$RT->{cvs} -f -l -Q -n log '$Is'|"
+ || die "unable to open CVS command pipe for reading";
+ $rcslog .= $_ while (<$io>);
+ $io->close;
+ }
+ else {
+ my $cvs = new CVS ($RT->{cvs}, $RT->{cvsroot});
+ $cvs->directory($cvsdir);
+ $cvs->entry($Is);
+ $cvs->arguments($Is);
+ $cvs->send("log");
+ $rcslog = scalar $cvs->result;
+ $cvs->close;
+ }
+ if ($rcslog =~ m|^head:\s+([\d.]+)|m) {
+ $Iv = $1;
+ }
+ }
+
# read file log entry
my $rcslog = '';
- if ($Io eq 'A' or $Io eq 'M') {
+ if ($Io eq 'A' or $Io eq 'M' or $Io eq 'R') {
if (not $RT->{useserver}) {
my $io = new IO::File "$RT->{cvs} -f -l -Q -n log -r$Iv '$Is'|"
|| die "unable to open CVS command pipe for reading";
@@ -1719,11 +1744,21 @@
$d =~ s|^(\+\+\+\s+)${Is_quoted}(\s+)|$1$cvsdir/$Is$2|m;
$cvsdiff .=
"<Diff $cvsdir/$Is>\n" .
- "Index: $cvsdir/$Is\n" .
- "============================================================\n" .
- "\$ cvs diff -u -r$IV -r$Iv $Is\n" .
- $d .
- "</Diff>\n";
+ "Index: $cvsdir/$Is\n" .
+ "============================================================\n" .
+ "\$ cvs diff -u -r$IV -r$Iv $Is\n" .
+ $d .
+ "</Diff>\n";
+ }
+ }
+ elsif ($Io eq 'R') {
+ if ($Ik eq 'b' or -B $Is) {
+ # file seems to be a binary file
+ # FIXME
+ }
+ else {
+ # file seems to be a regular file
+ # FIXME
}
}
@@ -1780,11 +1815,6 @@
$cvsinfo =~ m|^([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+)$|
|| die "invalid loginfo argument `$cvsinfo' while accumulating information";
my ($Is, $IV, $Iv, $It, $Io, $Ik, $ID, $Id) = ($1, $2, $3, $4, $5, $6, $7, $8, $9);
- if ($Io eq 'R' and $ID eq '0') {
- # CVS does not provide a commit time for removed files
- # so use the current time as a replacement
- $ID = time();
- }
my $e = {};
$e->{oldrev} = $IV;
$e->{newrev} = $Iv;
|