@matheusbsbs / matheus-bagliano / commits / 551ce28fe1
Fork 0

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>

Eric Wong committed Feb 20, 2006 at 10:57 UTC 551ce28fe1f2777eee7dd9c02bd44f55f4b32361
1 file changed +11 -2
contrib/git-svn/git-svn.perl
+11 -2
@@ -1,4 +1,6 @@
1 #!/usr/bin/env perl
2 +# Copyright (C) 2006, Eric Wong <normalperson@yhbt.net>
3 +# License: GPL v2 or later
4 use warnings;
5 use strict;
6 use vars qw/ $AUTHOR $VERSION
@@ -6,7 +8,7 @@ use vars qw/ $AUTHOR $VERSION
8 $GIT_SVN_INDEX $GIT_SVN
9 $GIT_DIR $REV_DIR/;
10 $AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
9 -$VERSION = '0.9.0';
11 +$VERSION = '0.9.1';
12 $GIT_DIR = $ENV{GIT_DIR} || "$ENV{PWD}/.git";
13 $GIT_SVN = $ENV{GIT_SVN_ID} || 'git-svn';
14 $GIT_SVN_INDEX = "$GIT_DIR/$GIT_SVN/index";
@@ -31,7 +33,7 @@ use File::Spec qw//;
33 my $sha1 = qr/[a-f\d]{40}/;
34 my $sha1_short = qr/[a-f\d]{6,40}/;
35 my ($_revision,$_stdin,$_no_ignore_ext,$_no_stop_copy,$_help,$_rmdir,$_edit,
34 - $_find_copies_harder, $_l);
36 + $_find_copies_harder, $_l, $_version);
37
38 GetOptions( 'revision|r=s' => \$_revision,
39 'no-ignore-externals' => \$_no_ignore_ext,
@@ -41,6 +43,7 @@ GetOptions( 'revision|r=s' => \$_revision,
43 'help|H|h' => \$_help,
44 'find-copies-harder' => \$_find_copies_harder,
45 'l=i' => \$_l,
46 + 'version|V' => \$_version,
47 'no-stop-on-copy' => \$_no_stop_copy );
48 my %cmd = (
49 fetch => [ \&fetch, "Download new revisions from SVN" ],
@@ -66,6 +69,7 @@ foreach (keys %cmd) {
69 }
70 }
71 usage(0) if $_help;
72 +version() if $_version;
73 usage(1) unless (defined $cmd);
74 svn_check_ignore_externals();
75 $cmd{$cmd}->[0]->(@ARGV);
@@ -91,6 +95,11 @@ and want to keep them separate.
95 exit $exit;
96 }
97
98 +sub version {
99 + print "git-svn version $VERSION\n";
100 + exit 0;
101 +}
102 +
103 sub rebuild {
104 $SVN_URL = shift or undef;
105 my $repo_uuid;