VCfs
view release on metacpan or search on metacpan
lib/VCfs.pm view on Meta::CPAN
return(split(/\n/, $r{out}));
} # end subroutine list definition
########################################################################
=head2 revert
$vc->revert(@files);
=cut
sub revert {
my $self = shift;
my (@files) = @_;
@files or die "need files";
my %r = $self->_do_run('revert', @files);
# TODO read the qr/Reverted '([^']+)'/ lines?
warn $r{out};
} # end subroutine revert definition
########################################################################
=head2 status
Returns a hash of files and their status codes.
%status = $vc->status(@files);
=cut
sub status {
my $self = shift;
my @files = @_;
my %r = $self->_do_run('status', @files);
$r{err} and warn "eek! $r{err} ($r{status})";
$r{ret} or warn "eek";
$r{out} or return();
return(map({reverse(split(/\s+/, $_, 2))}
split(/\n/, $r{out})
));
} # end subroutine status definition
########################################################################
=head2 propget
$vc->propget($propname, $url||$file);
=cut
sub propget {
my $self = shift;
my ($prop, $file) = @_;
my %r = $self->_do_run('propget', $prop, $file);
defined(my $string = $r{out}) or croak("nothing there");
die "this is unfinished";
} # end subroutine propget definition
########################################################################
=head2 propset
Takes an array reference or string for propvals.
$vc->propset($propname, \@vals, @files);
$vc->propset($propname, $valstring, @files);
=cut
sub propset {
my $self = shift;
my ($prop, $val, @files) = @_;
if(ref($val)) {
UNIVERSAL::isa($val, 'ARRAY') or die;
$val = join("\n", @$val);
}
my %r = $self->_do_run('propset', $prop, $val, @files);
$r{err} and warn "eek! $r{err} ($r{status})";
$r{ret} or warn "eek";
return($r{ret});
} # end subroutine propset definition
########################################################################
=head1 AUTHOR
Eric Wilhelm @ <ewilhelm at cpan dot org>
http://scratchcomputing.com/
=head1 BUGS
If you found this module on CPAN, please report any bugs or feature
requests through the web interface at L<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.
=head1 COPYRIGHT
Copyright (C) 2004-2009 Eric L. Wilhelm, All Rights Reserved.
=head1 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.
=head1 LICENSE
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=cut
# vi:sw=2:ts=2:et:sta
1;
( run in 2.285 seconds using v1.01-cache-2.11-cpan-71847e10f99 )