Cvs(3pm)
β¨ 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 likerdifforrtag. lowkey optional depending on your situation β¨cvsrootβ the address of the cvsroot. peep theCvs::Cvsrootmodule documentation for more info on whichCVSROOTs 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 theCVSROOTvalue for you. you still gotta supplypasswordand the other authentication values though, no skipping that. and if Cvs can't figure out theCVSROOTvalue? an error will be thrown and the object will not be created. π- **
password,passphrase, ...** β every single option thatCvs::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-Acvs checkout option).revisionβ specify the revision to checkout the module (See the-rcvs checkout option).dateβ specify the date from when to checkout the module (See the-Dcvs 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 aCvs::Result::StatusListobject back, and status on more than one file can be handled. if false, you get aCvs::Result::StatusItemobject 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 (Defaulttrue).
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 tofalse. β οΈ yes she will absolutely drop it anyway.delete_afterβ a boolean value that activates directory removal after a release. Defaults tofalse. 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 π
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
- debian trixie: libcvs-perl 0.07-5 Β· LGPL-2.1-or-later
- ubuntu noble: libcvs-perl 0.07-5 Β· LGPL-2.1-or-later
- ubuntu resolute: libcvs-perl 0.07-5 Β· LGPL-2.1-or-later
- ubuntu stonking: libcvs-perl 0.07-5 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms