Index: ossp-pkg/shiela/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/shiela/ChangeLog,v rcsdiff -q -kk '-r1.45' '-r1.46' -u '/v/ossp/cvs/ossp-pkg/shiela/ChangeLog,v' 2>/dev/null --- ChangeLog 2004/05/10 13:38:24 1.45 +++ ChangeLog 2004/05/10 17:57:48 1.46 @@ -9,6 +9,12 @@ ChangeLog + Changes between 1.1.1 and 1.1.2 (10-May-2002 to 10-May-2004): + + *) Optimize and bugfix the determination of the number of + lines in case of added files. + [Ralf S. Engelschall] + Changes between 1.1.0 and 1.1.1 (07-May-2002 to 10-May-2004): *) Workaround a syntax problem under Solaris /bin/sh. Index: ossp-pkg/shiela/shiela.pl RCS File: /v/ossp/cvs/ossp-pkg/shiela/shiela.pl,v rcsdiff -q -kk '-r1.57' '-r1.58' -u '/v/ossp/cvs/ossp-pkg/shiela/shiela.pl,v' 2>/dev/null --- 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) {