summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 48d044b)
raw | patch | inline | side by side (parent: 48d044b)
author | Eric Wong <normalperson@yhbt.net> | |
Thu, 23 Nov 2006 22:54:04 +0000 (14:54 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 23 Nov 2006 23:17:45 +0000 (15:17 -0800) |
some SVN repositories have a revision 0 (committed by no author
and no date) when created; so when we need to ensure that we
check any revision variables are defined, and not just
non-zero.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
and no date) when created; so when we need to ensure that we
check any revision variables are defined, and not just
non-zero.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-svn.perl | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index f0db4af58c69f6f542552651dcde02be02905f3b..6feae56c0eb9856f018da33a4a1461be7c01373d 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
my @commit = grep(/^git-svn-id: /,`git-cat-file commit $c`);
next if (!@commit); # skip merges
my ($url, $rev, $uuid) = extract_metadata($commit[$#commit]);
- if (!$rev || !$uuid) {
+ if (!defined $rev || !$uuid) {
croak "Unable to extract revision or UUID from ",
"$c, $commit[$#commit]\n";
}
print STDERR "Needed URL or usable git-svn id command-line\n";
commit_diff_usage();
}
- my $r = shift || $_revision;
- die "-r|--revision is a required argument\n" unless (defined $r);
+ my $r = shift;
+ unless (defined $r) {
+ if (defined $_revision) {
+ $r = $_revision
+ } else {
+ die "-r|--revision is a required argument\n";
+ }
+ }
if (defined $_message && defined $_file) {
print STDERR "Both --message/-m and --file/-F specified ",
"for the commit message.\n",
my $id = shift or return (undef, undef, undef);
my ($url, $rev, $uuid) = ($id =~ /^git-svn-id:\s(\S+?)\@(\d+)
\s([a-f\d\-]+)$/x);
- if (!$rev || !$uuid || !$url) {
+ if (!defined $rev || !$uuid || !$url) {
# some of the original repositories I made had
# identifiers like this:
($rev, $uuid) = ($id =~/^git-svn-id:\s(\d+)\@([a-f\d\-]+)/);