NAME
VCfs - Version Control agnostic interface on the local system
Synopsis
my $vc = VCfs->new(".");
my %status = $vc->status;
my @tags = $vc->taglist;
About
I need somewhere to put all of this repeated code. There are probably other modules on the CPAN which do this sort of thing differently. The basic idea is to just capture output from shelling-out to the appropriate frontend command for a given version control tool. Examples of usage can be found in the 'bin/' directory of this distribution.
Where necessary, assumes a typical "trunk,branches,tags" layout.
This currently supports svn and svk. Your help and input is welcome.
Constructor
new
$vc = VCfs->new($dir|$file, \%options);
Methods
detect
Tries to guess at what sort of VCS by examining the directory.
$vc->detect;
_do_run
%res = $vc->_do_run(@command);
is_<type>
Returns true if the underlying VCS is <type>.
These are mostly used internally to handle special cases.
- is_svn
- is_svk
- is_cvs
- is_darcs
get_log
$vc->get_log($target);
get_log_times
$vc->get_log_times($target);
get_info
my %vals = $vc->get_info;
taglist
my @tags = $vc->taglist;
tag_dir
my $dir = $vc->tag_dir;
taggit
(Currently) assumes a proj/trunk, proj/tags layout and that we're looking at trunk. I guess you could tag a branch, but, uh...
$vc->taggit($tagname, message => $message);
Big issue: There is no syntax of copy that prevents writing into an existing tag directory. The subversion developers seem to think this should be handled via pre-commit hooks (see http://svn.haxx.se/users/archive-2005-11/0056.shtml for details.)
normal methods
Just abstraction for standard commands.
add
$vc->add(@files);
remove
$vc->remove(@files);
commit
$vc->commit($message, @files);
update
$vc->update;
list
my @list = $vc->list($path);
revert
$vc->revert(@files);
status
Returns a hash of files and their status codes.
%status = $vc->status(@files);
propget
$vc->propget($propname, $url||$file);
propset
Takes an array reference or string for propvals.
$vc->propset($propname, \@vals, @files);
$vc->propset($propname, $valstring, @files);
AUTHOR
Eric Wilhelm @ <ewilhelm at cpan dot org>
http://scratchcomputing.com/
BUGS
If you found this module on CPAN, please report any bugs or feature requests through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
If you pulled this development version from my /svn/, please contact me directly.
COPYRIGHT
Copyright (C) 2004-2009 Eric L. Wilhelm, All Rights Reserved.
NO WARRANTY
Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.
LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.