Scroll to navigation

Cvs(3pm) User Contributed Perl Documentation Cvs(3pm)

NAME

Cvs - Object oriented interface to the CVS command

SYNOPSIS

    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();

DESCRIPTION

bla bla

LEGACY CVS METHODS

new

    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 CVSROOT. Note that if you don't supply a cvs root but a working directory, Cvs will try to guess the CVSROOT value. You still need to supply password and others authentication values. If Cvs can't determine the CVSROOT 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.

checkout

    Cvs::Result::Checkout = $obj->checkout("module", {key => "value"});

Checkout the module "module" 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.

update

    Cvs::Result::Update = $cvs->update();

Cvs::Result::Update.

status

    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

diff

    Cvs::Result::DiffItem = $cvs->diff();
    Cvs::Result::DiffList = $cvs->diff({multiple => 1});

Cvs::Result::DiffItem, Cvs::Result::DiffList.

rdiff

    Cvs::Result::RdiffList =
      $cvs->rdiff("module", {from_revision => $rev});

Cvs::Result::RdiffList.

log

    Cvs::Result::Log = $cvs->log();

Cvs::Result::Log.

tag

    Cvs::Result::Tag = $cvs->tag("tag");

Cvs::Result::Tag.

rtag

    Cvs::Result::Tag = $cvs->rtag("module", "tag");

Cvs::Result::Rtag.

release

    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

export

    Cvs::Result::Export = $obj->export("module", {key => "value"});

Checkout the module "module" in the repository (the one that served to create the Cvs object) from the cvsroot given in parameter, but without the CVS administrative directories.

Allowed parameters are the same as for checkout. However, one of the options 'revision' or 'date' must be specified.

OTHERS METHODS

module_list

  my @modules = $cvs->module_list();

Returns the list of all modules which can be riched on the CVSROOT. 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 "-c" argument of the cvs' checkout sub-command.

ACCESSORS

cvsroot

Returns the Cvs::Cvsroot object.

working_directory

Returns the full path of the working directory

LICENCE

This library is free software; you can redistribute it and/or modify it under the terms of the GNU 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 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

COPYRIGHT

Copyright (C) 2003 - Olivier Poitrey

2021-01-07 perl v5.32.0