Cvs(3pm)

πŸ“¦
version 0.07 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Cvs ✨ <small>(the Cvs(3pm) page, from User Contributed Perl Documentation, obvi)</small>

okay bestie, buckle up πŸ’– you're about to meet Cvs β€” an Object oriented interface to the CVS command. no cap, she's an icon, she's giving 2003 but she still works. let's get into it 🫢


🌸 NAME 🌸

Cvs β€” Object oriented interface to the CVS command. that's it, that's the whole vibe ✨


πŸŽ€ 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();

see how she just… does things? main character energy fr fr πŸ‘‘


πŸ’œ DESCRIPTION πŸ’œ

bla bla πŸ™ˆ that's literally what the page says and we respect the author's choices here. moving on!


🌈 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";

okay so you're making a brand new Cvs object for the repository you passed in as the argument. and here's the slay part: the working directory doesn't need to already exist. she'll handle it, she's built different πŸ’…

and these are all the parameters you're allowed to hand her:

  • workdir β€” the path to the working directory. you literally don't need this one if you're only planning to use remote commands like rdiff or rtag. lowkey optional depending on your situation ✨
  • cvsroot β€” the address of the cvsroot. peep the Cvs::Cvsroot module documentation for more info on which CVSROOTs are supported. heads up though: if you don't supply a cvs root but you do give a working directory, Cvs will try to guess the CVSROOT value for you. you still gotta supply password and the other authentication values though, no skipping that. and if Cvs can't figure out the CVSROOT value? an error will be thrown and the object will not be created. πŸ’€
  • **password, passphrase, ...** β€” every single option that Cvs::Cvsrootsupports is supported here too. go read theCvs::Cvsroot` documentation for the details, bestie πŸ“–

🌸 checkout

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

checks out the module "module" in the repository (aka the one that was used to create the Cvs object) from the cvsroot given in the parameter. she's fetching, periodt πŸŽ€

these are the allowed parameters:

  • reset β€” a boolean value used to reset any sticky tags, dates or options (See the -A cvs checkout option).
  • revision β€” specify the revision to checkout the module (See the -r cvs checkout option).
  • date β€” specify the date from when to checkout the module (See the -D cvs checkout option).

and she returns a Cvs::Result::Checkout. 🫢

🧚 update

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

returns a Cvs::Result::Update. ✨

⭐ status

Cvs::Result::StatusItem = $cvs->status("file");

Cvs::Result::StatusList =
    $cvs->status("file1", "file2", {multiple => 1});

gets the status of one or more files. detective era πŸ”

allowed parameters, go:

  • multiple β€” a boolean value that specifies the type of object returned. if true, you get a Cvs::Result::StatusList object back, and status on more than one file can be handled. if false, you get a Cvs::Result::StatusItem object and only one file's status can be handled (the first one, if you passed several). πŸ™ˆ
  • recursive β€” if a directory is supplied, process it recursively (Default true).

returns Cvs::Result::StatusItem, Cvs::Result::StatusList. πŸ’–

πŸ“ diff

Cvs::Result::DiffItem = $cvs->diff();

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

returns Cvs::Result::DiffItem, Cvs::Result::DiffList. 🌸

πŸ’œ rdiff

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

returns a Cvs::Result::RdiffList. ✨

πŸŽ€ log

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

returns a Cvs::Result::Log. πŸ“–

πŸ‘‘ tag

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

returns a Cvs::Result::Tag. ⭐

πŸ¦‹ rtag

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

returns a Cvs::Result::Rtag. 🌈

πŸ’… release

Cvs::Result::Release = $cvs->release();

Cvs::Result::Release = $cvs->release('module', ..., {force => 1});

calls the release command. letting it go, healing era 🫢

if you call it with no directories to release, the self repository will be released.

  • force β€” a boolean value that activates a forced directory release even if some files were not committed. Defaults to false. ⚠️ yes she will absolutely drop it anyway.
  • delete_after β€” a boolean value that activates directory removal after a release. Defaults to false. bye bye directory πŸ‘‹

returns a Cvs::Result::Release. πŸ’–

🌸 export

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

checks out 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. clean girl aesthetic, no clutter ✨

the allowed parameters are the same as for checkout. However, one of the options revision or date must be specified. that's not optional bestie, pick one 😭


🧚 OTHERS METHODS 🧚

πŸ’« module_list

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

returns the list of all modules which can be reached on the CVSROOT. heads up: this method does 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. so like… sometimes it eats, sometimes it doesn't πŸ’€

and do NOT mix up this method with the -c argument of the cvs' checkout sub-command. different things, same energy, do not confuse them πŸ™ˆ


⭐ ACCESSORS ⭐

πŸŽ€ cvsroot

Returns the Cvs::Cvsroot object. your cvsroot, but make it an 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. 😭 (yes the caps are required, it's giving legal screaming)

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 (C) 2003 - Olivier Poitrey πŸ‘‘


okay and for the cute sign-off: this whole thing lives in perl v5.38.2, dated 2024-03-05, and it's the Cvs(3pm) page obvi πŸ’– now go check out some modules, bestie, you got this 🫢✨

πŸ“¦ where this page comes from