ossp-pkg/shiela/shiela.pl 1.57 -> 1.58
--- shiela.pl 2004/05/10 17:54:05 1.57
+++ shiela.pl 2004/05/10 17:57:48 1.58
@@ -1674,11 +1674,8 @@
}
else {
if ($Io eq 'A') {
- my $io = new IO::File "<$Is" || die "unable to open $Is for reading";
- my $l = 0;
- $l++ while (<$io>);
- $io->close;
- $Id = sprintf("+%d/-%d", $l, 0);
+ # determined later below when we have to read in the
+ # whole content anyway in order to create the difference.
}
elsif ($Io eq 'M') {
if ($rcslog =~ m|\ndate:.*lines:\s*([\d \t+-]+)|s) {
@@ -1710,10 +1707,14 @@
unlink("$RT->{tmpfile}.all");
my $io = new IO::File ">$RT->{tmpfile}.all"
|| die "unable to open temporary file $RT->{tmpfile}.all for writing";
+ my $l = 0;
if (not $RT->{useserver}) {
my $cvs = new IO::File "$RT->{cvs} -f -Q -n update -p -r$Iv '$Is'|"
|| die "unable to open CVS command pipe for reading";
- $io->print($_) while (<$cvs>);
+ while (<$cvs>) {
+ $io->print($_);
+ $l++;
+ }
$cvs->close;
}
else {
@@ -1722,9 +1723,14 @@
$cvs->entry($Is);
$cvs->arguments("-p", "-r$Iv", $Is);
$cvs->send("update");
- $io->print(scalar $cvs->result);
+ my $r = scalar $cvs->result;
+ $io->print($r);
$cvs->close;
+ if ($r ne '') {
+ $l++ while ($r =~ m/^/mg);
+ }
}
+ $Id = sprintf("+%d/-%d", $l, 0) if ($Ik eq 'b' or -B $Is);
$io->close;
if ($Ik eq 'b' or -B $Is) {
|
|