Object oriented interface to the cvs command
use Cvs; my $cvs = new Cvs ( '/path/to/repository/for/module', cvsroot => ':pserver:user@host:/path/to/cvs', password => 'secret' ) or die $Cvs::ERROR; $cvs->checkout('module'); ... my $status = $cvs->status('file'); if($status->is_modified) { $cvs->commit('file'); } $cvs->release({delete_after => 1}); $cvs->logout();
bla bla
Cvs = new Cvs ["workdir"] [key => "value" [, ...]];
my $obj = new Cvs "workdir";
my $obj = new Cvs "workdir", cvsroot => "/path/to/cvsroot";
my $obj = new Cvs cvsroot => ":pserver:user\@host:/path/to/cvs";
Create a new Cvs object for the repository given in argument. Note that the working directory doesn't need to already exist.
Allowed parameters are:
Path to the working directory. You don't need it if you plan to use only remote commands like rdiff or rtag.
Address of the cvsroot. See the Cvs::Cvsroot module documentation for more information on supported \s-1CVSROOT\s0. Note that if you don't supply a cvs root but a working directory, Cvs will try to guess the \s-1CVSROOT\s0 value. You still need to supply password and others authentication values. If Cvs can't determine the \s-1CVSROOT\s0 value, an error will be thrown and the object will not be created.
All options supported by Cvs::Cvsroot are supported here. Please see Cvs::Cvsroot documentation for more details.
Cvs::Result::Checkout = $obj->checkout("module", {key => "value"});
Checkout the module \*(L"module\*(R" in the repository (the one that served to create the Cvs object) from the cvsroot given in parameter.
Allowed parameters are:
Boolean value used to reset any sticky tags, dates or options (See the -A cvs checkout option).
Specify the revision to checkout the module (See the -r cvs checkout option).
Specify the date from when to checkout the module (See the -D cvs checkout option).
Cvs::Result::Checkout.
Cvs::Result::Update = $cvs->update();
Cvs::Result::Update.
Cvs::Result::StatusItem = $cvs->status("file");
Cvs::Result::StatusList = $cvs->status("file1", "file2", {multiple => 1});
Get the status of one of more files.
Allowed parameters are:
Boolean value that specify the type of object returned. If true, a Cvs::Result::StatusList object is returned, and status on more than one files can be handled. If false, a Cvs::Result::StatusItem object is return and only one file status can be handled (the first one if several).
If a directory is supplied, process it recursively (Default true).
Cvs::Result::StatusItem, Cvs::Result::StatusList
Cvs::Result::DiffItem = $cvs->diff();
Cvs::Result::DiffList = $cvs->diff({multiple => 1});
Cvs::Result::DiffItem, Cvs::Result::DiffList.
Cvs::Result::RdiffList = $cvs->rdiff("module", {from_revision => $rev});
Cvs::Result::RdiffList.
Cvs::Result::Log = $cvs->log();
Cvs::Result::Log.
Cvs::Result::Tag = $cvs->tag("tag");
Cvs::Result::Tag.
Cvs::Result::Tag = $cvs->rtag("module", "tag");
Cvs::Result::Rtag.
Cvs::Result::Release = $cvs->release();
Cvs::Result::Release = $cvs->release('module', ..., {force => 1});
Call the release command.
If call with no directories to release, self repository will be released.
Boolean value that activate a forced directory release even if some files was not committed. Defaults to false.
Boolean value that activate directory removal after a release. Default to false.
Cvs::Result::Release
Cvs::Result::Export = $obj->export("module", {key => "value"});
Checkout the module \*(L"module\*(R" in the repository (the one that served to create the Cvs object) from the cvsroot given in parameter, but without the \s-1CVS\s0 administrative directories.
Allowed parameters are the same as for checkout. However, one of the options 'revision' or 'date' must be specified.
my @modules = $cvs->module_list();
Returns the list of all modules which can be riched on the \s-1CVSROOT\s0. This method do something that cvs doesn't implement by itself, we use a little trick to get this list, and this perhaps not work with all cvs versions.
Do not mix up this method with the \*(L"-c\*(R" argument of the cvs' checkout sub-command.
Returns the Cvs::Cvsroot object.
Returns the full path of the working directory
This library is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but \s-1WITHOUT\s0 \s-1ANY\s0 \s-1WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. See the \s-1GNU\s0 Lesser General Public License for more details.
You should have received a copy of the \s-1GNU\s0 Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, \s-1MA\s0 02111-1307 \s-1USA\s0
Copyright (C) 2003 - Olivier Poitrey