#!/usr/bin/perl -w use strict; use SVK; our $VERSION = $SVK::VERSION; use SVK::I18N; 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 I S<[I]> [I] =head1 DESCRIPTION B 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, C, C. =item * Distributed branches. =item * Lightweight checkout copy management (no F<.svn> directories). =item * Advanced merge algorithms, like I and I. =back For more information about the SVK project, visit L. Run C 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.\n", $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"); }; unless ($ENV{SVKNOSVNCONFIG}) { SVN::Core::config_ensure (undef); $xd->{svnconfig} = SVN::Core::config_get_config (undef); } $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 Eclkao@clkao.orgE =head1 COPYRIGHT Copyright 2003-2005 by Chia-liang Kao Eclkao@clkao.orgE. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L =cut