Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Can any one help to correct the error which i got while using in the Code

by srins (Sexton)
on Jul 26, 2006 at 18:10 UTC ( #563853=perlquestion: print w/replies, xml ) Need Help??
srins has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,
I was using perl module Rcs for Revision Control System.In that i was using an method to retrive all my versions of Testcases.

my @all_testcase_versions=$rcsObj->revisions; print "All Testcase Versions:@all_testcase_versions\n";
Output of that method is
All Testcase Versions:1.4 1.3 1.2 1.1
In that Module i was trying to get the file by giving versions as input
something as
To retrieve a specific version my $specific_version = $rcsObj->get('1.2');
But this Functionality was not present in,so i tried to parse that using Rcs::Parser Module.
But in Rcs::Parser Module they were using
my $rcs = new RCS; my $ret = $rcs->load($filename); my $specific_version = $rcs->get('1.2');
But there was no module,but they have used as
my$rcs=new RCS;
I have changed that to
my $rcs=new Rcs;
in both my code and also in its file.But i am getting error as
Failed to retrieve revision info of test case - TC00631.xml due to sys +tem error: Can't locate object method "load" via package "Rcs" line 1 +514.

I have also tried to use
my $rcs = Rcs::Parser->new; my $ret = $rcs->load($rcstestcasename); my $specific_version = $rcs->get('1.2');
But i am not getting any Output.
Can any one help me in identifying what this my $rcs=new RCS;
Do i need to change anythign in my code.
OR,is there any module to retrive my files based on my version input.
Help needed to retrive my older files based on versions as input in CVS.
My Testcase in CVS is in Xml format.
say TC00631.xml and TC00631.xml,v
cat TC00631.xml,v gives, 1.2 log @Auto checked in by Portal @
My Code is
use Rcs; #use RCS; use Rcs::Parser; # create a Rcs instance for the test case's revision info my $rcsObj = Rcs->new; $rcsObj->rcsdir(dirname($rcsDir)); $rcsObj->workdir(dirname($rcsDir)); $rcsObj->file($testCaseName); my $rcstestcasename=$rcsObj->file($testCaseName); print "FileName:$rcstestcasename\n"; # abstract interesting revision info my @all_testcase_versions=$rcsObj->revisions; print "All Testcase Versions:@all_testcase_versions\n"; my $rcs = Rcs::Parser->new; my $ret = $rcs->load($rcstestcasename); my $specific_version = $rcs->get('1.2'); print "1.2version:$specific_version\n"; }; # end of eval
Can any one help in this regard.

20060726 Janitored by Corion: Removed PRE tags, as per Writeup Formatting Tips

Replies are listed 'Best First'.
Re: Can any one help to correct the error which i got while using in the Code
by VSarkiss (Monsignor) on Jul 27, 2006 at 01:22 UTC

    From looking at the module on CPAN, you have the right capitalization: it's use Rcs, not use RCS (although I don't see use RCS in the documentation -- maybe you have an old version?)

    As to what you're trying to do: I haven't used RCS in a while, but as far as I know, there is no rcs get command. If you want the text of the file at the particular revision, it looks like you should be doing something like this:

    my $rcs = Rcs->new; # guessing the next line from your question $rcs->file($testCaseName); # equivalent to running "co -r 1.2" on the command line; # that is, will retrieve version 1.2 without locking. $rcs->co("-r" => "1.2");
    At this point, the working file should contain the text of the file at the specific version. Since you know its directory and its name, you can manipulate it like any other file.

    Caveat: I haven't tested this code, and it's based on an old recollection of RCS. But I hope it will help point you in the right direction.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://563853]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2018-04-20 05:41 GMT
Find Nodes?
    Voting Booth?