git svn: catch lack of upstream info for dcommit earlier

Since 711521e 'git svn dcommit' attempts to use the upstream
information to determine the SVN URL, before it verifies that it even
found an upstream.  Move up the corresponding check.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
Thomas Rast 2008-08-31 15:50:59 +02:00 committed by Eric Wong
parent 991255c634
commit 2cb611054a

View File

@ -421,15 +421,15 @@ sub cmd_dcommit {
$head ||= 'HEAD'; $head ||= 'HEAD';
my @refs; my @refs;
my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs); my ($url, $rev, $uuid, $gs) = working_head_info($head, \@refs);
unless ($gs) {
die "Unable to determine upstream SVN information from ",
"$head history.\nPerhaps the repository is empty.";
}
$url = defined $_commit_url ? $_commit_url : $gs->full_url; $url = defined $_commit_url ? $_commit_url : $gs->full_url;
my $last_rev = $_revision if defined $_revision; my $last_rev = $_revision if defined $_revision;
if ($url) { if ($url) {
print "Committing to $url ...\n"; print "Committing to $url ...\n";
} }
unless ($gs) {
die "Unable to determine upstream SVN information from ",
"$head history.\nPerhaps the repository is empty.";
}
my ($linear_refs, $parents) = linearize_history($gs, \@refs); my ($linear_refs, $parents) = linearize_history($gs, \@refs);
if ($_no_rebase && scalar(@$linear_refs) > 1) { if ($_no_rebase && scalar(@$linear_refs) > 1) {
warn "Attempting to commit more than one change while ", warn "Attempting to commit more than one change while ",