Skip Menu |

This queue is for tickets about the Cvs CPAN distribution.

Report information
The Basics
Id: 12956
Status: open
Priority: 0/
Queue: Cvs

People
Owner: Nobody in particular
Requestors: captain_kirk [...] warpten.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.07
Fixed in: (no value)



Subject: object method "is_modified" problem
Cvs.pm version 0.07 perl, v5.8.6 built for i686-linux Slackware Linux 10.1 kernel 2.4.30 Error message: Can't locate object method "is_modified" via package "Cvs::Result::Base" at cvstest.pl line 9. Code: #!/usr/bin/perl -w use Cvs; use Env qw( $CVSROOT ); my $file = 'testfile'; my $cvs = new Cvs(cvsroot => "$CVSROOT") || die $Cvs::ERROR; my $status = $cvs->status('$file'); if ($status->is_modified) { $cvs->commit("$file"); }
From: pause [...] ls26.net
On Wed May 25 11:12:22 2005, guest wrote: Show quoted text
> Cvs.pm version 0.07 > perl, v5.8.6 built for i686-linux > Slackware Linux 10.1 kernel 2.4.30 > > Error message: > > Can't locate object method "is_modified" via package > "Cvs::Result::Base" at cvstest.pl line 9. > > Code: > > #!/usr/bin/perl -w > use Cvs; > use Env qw( $CVSROOT ); > > my $file = 'testfile'; > > my $cvs = new Cvs(cvsroot => "$CVSROOT") || die $Cvs::ERROR; > my $status = $cvs->status('$file'); > if ($status->is_modified) > { > $cvs->commit("$file"); > }
There are two factors at work here: firstly, status() requires that the files be in a workdir, and the example fails because none is specified; secondly, the way the module's error handling works is by returning an instance of Cvs::Result::Base, with the error message accessible via the error() accessor method. Cvs::Result::Base has no is_modified() method, hence the run-time error seen here. The first problem is trivially fixable by supplying a workdir argument to new(), e.g. my $cvs = new Cvs( '/path/to/my/workdir', cvsroot => "$CVSROOT") || die $Cvs::ERROR; The second problem is more fundamental.