From: Eric Wong <normalperson@yhbt.net>
To: Junio C Hamano <junkio@cox.net>, Pazu <pazu@pazu.com.br>
Cc: Seth Falcon <sethfalcon@gmail.com>, git@vger.kernel.org
Subject: [PATCH] git-svn: error out when the SVN connection fails during a fetch
Date: Tue, 28 Nov 2006 14:06:05 -0800 [thread overview]
Message-ID: <20061128220605.GA1253@localdomain> (raw)
finish_report does seem to return a useful value indicating success
or failure, so we'll just set a flag when close_edit is called
(it is not called on failures, nor is abort_edit) and check
the flag before proceeding.
Thanks to Pazu for pointing this out.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
git-svn.perl | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 7942bba..c3ad5ec 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2941,6 +2941,9 @@ sub libsvn_fetch_delta {
$reporter->set_path('', $last_rev, 0, @lock, $pool);
$reporter->finish_report($pool);
$pool->clear;
+ unless ($ed->{git_commit_ok}) {
+ die "SVN connection failed somewhere...\n";
+ }
libsvn_log_entry($rev, $author, $date, $msg, [$last_commit]);
}
@@ -3195,6 +3198,9 @@ sub libsvn_new_tree {
$reporter->set_path('', $rev, 1, @lock, $pool);
$reporter->finish_report($pool);
$pool->clear;
+ unless ($ed->{git_commit_ok}) {
+ die "SVN connection failed somewhere...\n";
+ }
} else {
open my $gui, '| git-update-index -z --index-info' or croak $!;
libsvn_traverse($gui, '', $SVN->{svn_path}, $rev);
@@ -3501,7 +3507,8 @@ sub abort_edit {
sub close_edit {
my $self = shift;
- close $self->{gui} or croak;
+ close $self->{gui} or croak $!;
+ $self->{git_commit_ok} = 1;
$self->SUPER::close_edit(@_);
}
--
1.4.4.1.ge151
next reply other threads:[~2006-11-28 22:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-28 22:06 Eric Wong [this message]
2006-11-28 22:24 ` [PATCH] git-svn: error out when the SVN connection fails during a fetch Eric Wong
2006-12-03 18:23 ` Florian Weimer
2006-12-04 8:52 ` Eric Wong
2006-12-04 8:56 ` Florian Weimer
2006-12-04 9:05 ` Eric Wong
2006-12-06 17:01 ` Florian Weimer
2006-12-06 19:01 ` Junio C Hamano
2006-12-06 19:45 ` Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061128220605.GA1253@localdomain \
--to=normalperson@yhbt.net \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=pazu@pazu.com.br \
--cc=sethfalcon@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).