SVK
view release on metacpan or search on metacpan
use Getopt::Long qw(:config no_ignore_case bundling);
use autouse 'SVK::Util' => qw(get_anchor catfile catdir find_dotsvk);
use Class::Autouse qw(SVK::Command SVK::XD);
=head1 NAME
svk - A Distributed Version Control System
=head1 SYNOPSIS
B<svk> I<command> S<[I<options>]> [I<args>]
=head1 DESCRIPTION
B<SVK> is a decentralized version control system written in Perl.
It uses the Subversion filesystem but provides additional features:
=over 4
=item * Offline operations like C<checkin>, C<log>, C<merge>.
=item * Distributed branches.
=item * Lightweight checkout copy management (no F<.svn> directories).
=item * Advanced merge algorithms, like I<star-merge> and I<cherry picking>.
=back
For more information about the SVK project, visit L<http://svk.bestpractical.com/>.
Run C<svk help> to access the built-in tool documentation.
By default svk stores its state in the F<.svk> directory in your home
directory. You can change this default by setting the SVKROOT environment
variable to your preferred svk depot path.
=cut
my $cmd = shift;
if (!$cmd or $cmd =~ /^-{0,2}[Hh](?:elp)?$/) {
SVK::Command->invoke (undef, 'help', undef, @ARGV);
exit 0;
}
{
my $show_version;
local *ARGV = [$cmd || ''];
GetOptions ('v|version' => \$show_version) or exit;
if ($show_version || ($cmd && $cmd eq 'version')) {
print loc("This is svk, version %1 (using Subversion bindings %2)\n",
$VERSION, $SVN::Core::VERSION);
exit 0;
}
}
$ENV{HOME} ||= (
$ENV{HOMEDRIVE} ? catdir(@ENV{qw( HOMEDRIVE HOMEPATH )}) : ''
) || (getpwuid($<))[7];
$ENV{USER} ||= (
(defined &Win32::LoginName) ? Win32::LoginName() : ''
) || $ENV{USERNAME} || (getpwuid($<))[0];
my $svkpath = find_dotsvk || $ENV{SVKROOT} || catfile($ENV{HOME}, ".svk");
my $floating = undef;
if (-e catfile($svkpath, 'floating')) {
require Path::Class;
$floating = Path::Class::Dir->new( $svkpath )->parent();
}
my $ret;
{
my $xd = SVK::XD->new ( giantlock => catfile($svkpath, 'lock'),
statefile => catfile($svkpath, 'config'),
svkpath => $svkpath,
floating => $floating,
);
$xd->load();
$SIG{INT} = sub {
die loc("Interrupted.\n");
};
$ret = SVK::Command->invoke ($xd, $cmd, undef, @ARGV);
$xd->store ();
}
1;
exit (defined $ret ? $ret : 1);
require PerlIO;
require PerlIO::via;
require PerlIO::scalar;
require Encode::TW;
=head1 AUTHORS
Chia-liang Kao E<lt>clkao@clkao.orgE<gt>
=head1 COPYRIGHT
Copyright 2003-2005 by Chia-liang Kao E<lt>clkao@clkao.orgE<gt>.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See L<http://www.perl.com/perl/misc/Artistic.html>
=cut
( run in 0.488 second using v1.01-cache-2.11-cpan-ceb78f64989 )