Re: how to skip branches on git svn clone/fetch when there are errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 7, 2009 at 11:30 AM, Daniele Segato<daniele.bilug@xxxxxxxxx> wrote:
> more info on the error (enabled the confess instead of croak to the
> Core.pm library)
>
> Use of uninitialized value in concatenation (.) or string at
> /usr/lib/perl5/SVN/Core.pm line 585.
> Authorization failed:  at /usr/lib/perl5/SVN/Core.pm line 654
>        SVN::Error::confess_on_error('_p_svn_error_t=SCALAR(0x9492a50)')
> called at /usr/lib/perl5/SVN/Ra.pm line 492
>        SVN::Ra::AUTOLOAD('Git::SVN::Ra=HASH(0x945dae8)',
> 'alfresco-enterprise-mirror/alfresco/BRANCHES/V2.1-A/root', 7738,
> 'SVN::Pool=REF(0x9492bc0)') called at /usr/bin/git-svn line 3760
>        Git::SVN::Ra::check_path('Git::SVN::Ra=HASH(0x945dae8)',
> 'alfresco-enterprise-mirror/alfresco/BRANCHES/V2.1-A/root', 7738)
> called at /usr/bin/git-svn line 4045
>        Git::SVN::Ra::get_dir_check('Git::SVN::Ra=HASH(0x945dae8)',
> 'HASH(0x92131e0)', 'HASH(0x9388050)', 7738) called at /usr/bin/git-svn
> line 4062
>        Git::SVN::Ra::match_globs('Git::SVN::Ra=HASH(0x945dae8)',
> 'HASH(0x92131e0)', 'HASH(0x9463c00)', 'ARRAY(0x90bbc00)', 7738) called
> at /usr/bin/git-svn line 3985
>        Git::SVN::Ra::gs_fetch_loop_common('Git::SVN::Ra=HASH(0x945dae8)',
> 7737, 16113, 'ARRAY(0x90bbbe0)', 'ARRAY(0x90bbc00)') called at
> /usr/bin/git-svn line 1415
>        Git::SVN::fetch_all('svn', 'HASH(0x9464250)') called at
> /usr/bin/git-svn line 372
>        main::cmd_fetch() called at /usr/bin/git-svn line 253
>        eval {...} called at /usr/bin/git-svn line 251
>
>
> I'll keep looking at it to see if I can figure out a way to "skip" the
> error myself and, eventually, provide a patch

I played a little with perl and modified the code

I attach the patch I created...
it probably sucks and doesn't take cares of a lot of thing that I
didn't thought about...

After applying it I was able to continue the git svn fetch from the
point I left skipping those problematics paths...

Still I get a lot of warnings with:
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/SVN/Core.pm line 584


I just want you to take a look at it
I will not be disappointed if you place this patch in the recycle bean :)

I cloned the git repo, checked out the v1.5.6.5 tag (which is my
current version) and modified the git-svn.perl file.

It probably wont help but I think I should share it anyway

(patch below my signature)

Bye,
Daniele

>From e8a1a12e83b3f0b18ce842190d8fc8eddaa77f68 Mon Sep 17 00:00:00 2001
From: Daniele Segato <daniele.bilug@xxxxxxxxx>
Date: Mon, 7 Sep 2009 15:30:14 +0200
Subject: [PATCH] Ignore error 175007 authorization failed 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 |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index a366c89..0ab6453 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3756,7 +3756,23 @@ 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 == 175007) {
+			warn "W: Ignoring error from SVN, path probably ",
+				"does not exist: ($errno): ",
+				$err->expanded_message,"\n";
+		}
+		return;
+	};
+
 	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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]