Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: CVS repository via Perl

by shushu (Scribe)
on Nov 05, 2002 at 14:55 UTC ( #210469=note: print w/replies, xml ) Need Help??


in reply to Re: CVS repository via Perl
in thread CVS repository via Perl

Hi, Thanks for the feedback.
I did look into VCS support, and went over their mailing list archive. First of all - it is very quiet there. Second - it gives no information except "look at our examples". Well - I looked into them, and they work with a copy, after cehckout.

Now to the question - do I understand CVS, because if I do understand why won't I "checkout" before I start to work.
Well, let's just say I know CVS well enough.
If you will look into cvsweb for example, or Apache::CVS, they both work direcrly with the CVS repository, and whenever they can't - they immitate a working directory or do some "magic" to solve this problem (look into cvsweb doAnnotate, for example, where they use cvs server command).
The reasons I need a direct work with a repository are complicated (maybe another message...), but in the bottom line I need to keep live and updated branches (around 4 branches) that weight 200MB each on more then 20 machines.
Just keeping a copy of all of the branches on every machine will be a headache.

What I currently try to do is to immitate Apache request. If I will succeed I will be able to work with Apache::CVS not via the Apache.
I am not sure it is such a good idea, but I will give it a shot since it can short my development process a lot.

Any more ideas ?
Thanks,
shushu

Replies are listed 'Best First'.
Re: Re: Re: CVS repository via Perl
by shushu (Scribe) on Nov 05, 2002 at 16:04 UTC
    Hi again,
    I think I have the solution I needed.
    Using Apache::CVS::* modules directly seems to give me exactly what I need.

    See the code below that brings me the last revision of a file:
    use Apache::CVS::RcsConfig(); use Apache::CVS::PlainFile(); use Apache::CVS::Directory(); use Apache::CVS::File(); use Apache::CVS::Revision(); # /tmp/remote/ is the directory of my CVS module in the repository my $PATH = "/tmp/remote//VC_DB/utilities/pack_conf.pl"; my $RCSCONFIG = Apache::CVS::RcsConfig->new(); my $file = Apache::CVS::File->new($PATH, $RCSCONFIG); my $LAST = $file->revision('prev'); print $LAST->content;

    In addition, all of the Apache::CVS::* modules can give a nice and working direct access to the CVS repository.
    The main idea is - you don't need to know how it is done !

    I believe those modules should be moved from below Apache.

    Have a nice day,
    shushu
      Hi,
      Below is the mail I sent to John Barbee:

      Hi John,

      When working I am trying to get a directory object and go over all of its sub directories.
      I found out that when I am asking for the name of the subdir object, I get an error message.

      The error message is:
      Can't call method "extension" on an undefined value at /usr/lib/perl5/site_perl/5.6.1/Apache/CVS/File.pm line 231 (#1 +) (F) You used the syntax of a method call, but the slot filled by t +he object reference or package name contains an undefined value. Som +ething like this will reproduce the error:
      Looking on the subdir object I saw its rcsconfig object is undef.
      Looking in sub load in Apache::CVS::Directory I saw the following:
      foreach my $path ( @directories ) { $self->push('directory', Apache::CVS::Directory->new($self->path() . "/$pat +h")); }
      And:
      foreach my $path ( @files ) { if ( $path =~ /,v$/ ) { $self->push('file', Apache::CVS::File->new($self->path() . "/$path +", $self->rcs_confi +g())); } else { $self->push('plain_file', Apache::CVS::PlainFile->new($self->path() . "/ +$path")); } }

      The bottom line is - just by fixing the directory object creation to work like the file creation by sending the $self->rcsconfig object it seems I fixed the problem.
      Is it a bug ?
      Maybe you did this for a reason, and I harm something else by fixing it like that ?
      If it is a bug, and this is a good fix, how do we proceed to release a new version ?
      Thanks,
      And I will appriciate a quick response,
      shushu

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://210469]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2021-11-29 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?