git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniele Segato <daniele.bilug@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: Re: how to skip branches on git svn clone/fetch when there are errors
Date: Mon, 7 Sep 2009 15:53:44 +0200	[thread overview]
Message-ID: <9accb4400909070653s4ddb07e4k54dde8d801b4b5e4@mail.gmail.com> (raw)
In-Reply-To: <9accb4400909070634oee46b78g9270586a2b0eb4b9@mail.gmail.com>

On Mon, Sep 7, 2009 at 3:34 PM, Daniele Segato<daniele.bilug@gmail.com> wrote:
> +       $SVN::Error::handler = sub {
> +               (my $err) = @_;
> +               my $errno = $err->apr_err();
> +               my $err_key = $err->expanded_message;
> +               if ($errno == 175007) {
> +                       warn "W: Ignoring error from SVN, path probably ",
> +                               "does not exist: ($errno): ",
> +                               $err->expanded_message,"\n";
> +               }
> +               return;



ups..
this should have been return inside the if and die otherwise

and the error is 170001 (wrong copy/paste)

please ignore the patch I posted before

this is the "right" one:


From a17dfb0e268e11ce70587ccb48c359348f22ad99 Mon Sep 17 00:00:00 2001
From: Daniele Segato <daniele.bilug@gmail.com>
Date: Mon, 7 Sep 2009 15:30:14 +0200
Subject: [PATCH] Ignore err:170001 authorizationfailed on checkpath

I don't know if this is the best solution to solve the issue but it does
let me download the repo skipping the problematics paths
---
 git-svn.perl |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index a366c89..80f958d 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3756,7 +3756,24 @@ sub check_path {
 		return $cache->{data}->{$path};
 	}
 	my $pool = SVN::Pool->new;
+	my $err_handler = $SVN::Error::handler;
+	$SVN::Error::handler = sub {
+		(my $err) = @_;
+		my $errno = $err->apr_err();
+		my $err_key = $err->expanded_message;
+		if ($errno == 170001) {
+			warn "W: Ignoring error from SVN, path probably ",
+				"does not exist: ($errno): ",
+				$err->expanded_message,"\n";
+			return;
+		}
+		die "Error from SVN, ($errno): ", $err->expanded_message,"\n";
+	};
+
 	my $t = $self->SUPER::check_path($path, $r, $pool);
+
+	$SVN::Error::handler = $err_handler;
+
 	$pool->clear;
 	if ($r != $cache->{r}) {
 		%{$cache->{data}} = ();
-- 
1.5.6.5

  reply	other threads:[~2009-09-07 13:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-31  8:26 how to skip branches on git svn clone/fetch when there are errors Daniele Segato
2009-09-05  6:16 ` Eric Wong
2009-09-05  8:55   ` Daniele Segato
2009-09-06  1:48     ` Eric Wong
2009-09-07  9:30 ` Daniele Segato
2009-09-07 13:34   ` Daniele Segato
2009-09-07 13:53     ` Daniele Segato [this message]
2009-09-07 15:53     ` Paolo Ciarrocchi
2009-09-07 17:55       ` Daniele Segato

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=9accb4400909070653s4ddb07e4k54dde8d801b4b5e4@mail.gmail.com \
    --to=daniele.bilug@gmail.com \
    --cc=git@vger.kernel.org \
    /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).