git-svn: 0.9.1: add --version and copyright/license (GPL v2+) information

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Eric Wong 2006-02-20 10:57:29 -08:00 коммит произвёл Junio C Hamano
Родитель 96a40b27c9
Коммит 551ce28fe1
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -1,4 +1,6 @@
#!/usr/bin/env perl #!/usr/bin/env perl
# Copyright (C) 2006, Eric Wong <normalperson@yhbt.net>
# License: GPL v2 or later
use warnings; use warnings;
use strict; use strict;
use vars qw/ $AUTHOR $VERSION use vars qw/ $AUTHOR $VERSION
@ -6,7 +8,7 @@ use vars qw/ $AUTHOR $VERSION
$GIT_SVN_INDEX $GIT_SVN $GIT_SVN_INDEX $GIT_SVN
$GIT_DIR $REV_DIR/; $GIT_DIR $REV_DIR/;
$AUTHOR = 'Eric Wong <normalperson@yhbt.net>'; $AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
$VERSION = '0.9.0'; $VERSION = '0.9.1';
$GIT_DIR = $ENV{GIT_DIR} || "$ENV{PWD}/.git"; $GIT_DIR = $ENV{GIT_DIR} || "$ENV{PWD}/.git";
$GIT_SVN = $ENV{GIT_SVN_ID} || 'git-svn'; $GIT_SVN = $ENV{GIT_SVN_ID} || 'git-svn';
$GIT_SVN_INDEX = "$GIT_DIR/$GIT_SVN/index"; $GIT_SVN_INDEX = "$GIT_DIR/$GIT_SVN/index";
@ -31,7 +33,7 @@ use File::Spec qw//;
my $sha1 = qr/[a-f\d]{40}/; my $sha1 = qr/[a-f\d]{40}/;
my $sha1_short = qr/[a-f\d]{6,40}/; my $sha1_short = qr/[a-f\d]{6,40}/;
my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit, my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit,
$_find_copies_harder, $_l); $_find_copies_harder, $_l, $_version);
GetOptions( 'revision|r=s' => \$_revision, GetOptions( 'revision|r=s' => \$_revision,
'no-ignore-externals' => \$_no_ignore_ext, 'no-ignore-externals' => \$_no_ignore_ext,
@ -41,6 +43,7 @@ GetOptions( 'revision|r=s' => \$_revision,
'help|H|h' => \$_help, 'help|H|h' => \$_help,
'find-copies-harder' => \$_find_copies_harder, 'find-copies-harder' => \$_find_copies_harder,
'l=i' => \$_l, 'l=i' => \$_l,
'version|V' => \$_version,
'no-stop-on-copy' => \$_no_stop_copy ); 'no-stop-on-copy' => \$_no_stop_copy );
my %cmd = ( my %cmd = (
fetch => [ \&fetch, "Download new revisions from SVN" ], fetch => [ \&fetch, "Download new revisions from SVN" ],
@ -66,6 +69,7 @@ foreach (keys %cmd) {
} }
} }
usage(0) if $_help; usage(0) if $_help;
version() if $_version;
usage(1) unless (defined $cmd); usage(1) unless (defined $cmd);
svn_check_ignore_externals(); svn_check_ignore_externals();
$cmd{$cmd}->[0]->(@ARGV); $cmd{$cmd}->[0]->(@ARGV);
@ -91,6 +95,11 @@ and want to keep them separate.
exit $exit; exit $exit;
} }
sub version {
print "git-svn version $VERSION\n";
exit 0;
}
sub rebuild { sub rebuild {
$SVN_URL = shift or undef; $SVN_URL = shift or undef;
my $repo_uuid; my $repo_uuid;