Git development
 help / color / mirror / Atom feed
* [PATCH] git-svn: use SVN::Ra::get_dir2 when possible
@ 2014-10-31 10:15 Eric Wong
  2014-10-31 10:34 ` [PATCH v2] " Eric Wong
  2014-11-02 12:31 ` [PATCH] " Hin-Tak Leung
  0 siblings, 2 replies; 12+ messages in thread
From: Eric Wong @ 2014-10-31 10:15 UTC (permalink / raw)
  To: Hin-Tak Leung
  Cc: stoklund, fabian.schmied, git, sam, stevenrwalter, waste.manager,
	amyrick

This avoids the following failure with normal "get_dir" on newer
versions of SVN (tested with SVN 1.8.8-1ubuntu3.1):

  Incorrect parameters given: Could not convert '%ld' into a number

get_dir2 also has the potential to be more efficient by requesting
less data.

ref: <1414636504.45506.YahooMailBasic@web172304.mail.ir2.yahoo.com>
ref: <1414722617.89476.YahooMailBasic@web172305.mail.ir2.yahoo.com>

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
---
  This should fix the vbox clone problem.  SVN Perl binding
  breakage (again :<).  I shall revert the int() changes.

  > I added those two lines to my git and there is no improvement. It
  > still won't svn fetch the next revision. I think it may be
  > important/interesting to find out when or how it becomes non-int, so
  > I have tar'gz'ed my wont-fetch virtual box .git and in the middle of
  > uploading here: 
  >
  > http://sourceforge.net/projects/outmodedbonsai/files/R/

  > I am also uploading my old R clone also - maybe you'd like to see
  > why its .git/svn/.caches is so big compared to a recent one,

  Jakob's changes causes different access patterns, so it's expected the
  sizes vary.  I also changed the cherry pick cache and removed the
  _rev_list caching entirely, so it should be much smaller now.

  > as well as how and why there were an extra merge and two missing
  > merges compared to a recent clone?

  The different merges are fine, I think, as stated in
    http://mid.gmane.org/20141030230831.GA14160@dcvr.yhbt.net

 perl/Git/SVN/Ra.pm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm
index 82d6108..1e52709 100644
--- a/perl/Git/SVN/Ra.pm
+++ b/perl/Git/SVN/Ra.pm
@@ -177,7 +177,17 @@ sub get_dir {
 		}
 	}
 	my $pool = SVN::Pool->new;
-	my ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);
+	my ($d, undef, $props);
+
+	if (defined &SVN::Ra::get_dir2) { # appeared in SVN 1.4
+		# n.b. in addition to being potentially more efficient,
+		# this works around what appears to be a bug in some
+		# SVN 1.8 versions
+		my $kind = 1; # SVN_DIRENT_KIND
+		($d, undef, $props) = $self->get_dir2($dir, $r, $kind, $pool);
+	} else {
+		($d, undef, $props) = $self->get_dir($dir, $r, $pool);
+	}
 	my %dirents = map { $_ => { kind => $d->{$_}->kind } } keys %$d;
 	$pool->clear;
 	if ($r != $cache->{r}) {
-- 
EW

^ permalink raw reply related	[flat|nested] 12+ messages in thread
* Re: [PATCH v2] git-svn: use SVN::Ra::get_dir2 when possible
@ 2014-10-31 21:09 Hin-Tak Leung
  2014-10-31 21:42 ` Eric Wong
  0 siblings, 1 reply; 12+ messages in thread
From: Hin-Tak Leung @ 2014-10-31 21:09 UTC (permalink / raw)
  To: normalperson, git
  Cc: stoklund, fabian.schmied, sam, stevenrwalter, waste.manager,
	amyrick



------------------------------
On Fri, Oct 31, 2014 19:08 GMT Eric Wong wrote:

>Eric Wong <normalperson@yhbt.net> wrote:
>> This avoids the following failure with normal "get_dir" on newer
>> versions of SVN (tested with SVN 1.8.8-1ubuntu3.1):
>> 
>>   Incorrect parameters given: Could not convert '%ld' into a number
>
>Filed a bug in Debian since I hit it in sid, too:
>http://bugs.debian.org/767530
>
>Thanks all.


Hmm, but why are you filing at debian? I had the error when i applied the dev code patches on top of 2.1.0, and the error disappeared as soon as I reverted the patches. So it looks like a issue for the upstream developers, rather than distro. Are you saying debian is shipping a dev snapshot of git svn?

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH v2] git-svn: use SVN::Ra::get_dir2 when possible
@ 2014-10-31 21:53 Hin-Tak Leung
  2014-10-31 23:22 ` Eric Wong
  0 siblings, 1 reply; 12+ messages in thread
From: Hin-Tak Leung @ 2014-10-31 21:53 UTC (permalink / raw)
  To: normalperson
  Cc: stoklund, fabian.schmied, git, sam, stevenrwalter, waste.manager,
	amyrick

-------------------------
On Fri, Oct 31, 2014 10:34 GMT Eric Wong wrote:

>This avoids the following failure with normal "get_dir" on newer
>versions of SVN (tested with SVN 1.8.8-1ubuntu3.1):
>
>  Incorrect parameters given: Could not convert '%ld' into a number
>
>get_dir2 also has the potential to be more efficient by requesting
>less data.
>
>ref: <1414636504.45506.YahooMailBasic@web172304.mail.ir2.yahoo.com>
>ref: <1414722617.89476.YahooMailBasic@web172305.mail.ir2.yahoo.com>
>
>Signed-off-by: Eric Wong <normalperson@yhbt.net>
>Cc: Hin-Tak Leung <htl10@users.sourceforge.net>

Tested-by: Hin-Tak Leung <htl10@users.sourceforge.net>

Okay, this one on top of my "git 2.1.0 + 10 recent git svn improvement patches"
allow me to fetch further.

I suspect the problem must be elsewhere though, and this just band-aided
over it.

For me, reverting the additional patches and just use git 2.1.0 also allow
me to fetch further, so the problem appear to me to be associated with
the additional patches. But you are saying that git-svn on debian as shipped
exhibit this problem? 

>---
> Sorry, waaay past my bed time.  This version doesn't infinite loop
> on autoload or older SVN(*) (at least I hope it doesn't)
>
> perl/Git/SVN/Ra.pm | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
>diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm
>index 82d6108..496f430 100644
>--- a/perl/Git/SVN/Ra.pm
>+++ b/perl/Git/SVN/Ra.pm
>@@ -177,7 +177,17 @@ sub get_dir {
>         }
>     }
>     my $pool = SVN::Pool->new;
>-    my ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);
>+    my ($d, undef, $props);
>+
>+    if (::compare_svn_version('1.4.0') >= 0) {
>+        # n.b. in addition to being potentially more efficient,
>+        # this works around what appears to be a bug in some
>+        # SVN 1.8 versions
>+        my $kind = 1; # SVN_DIRENT_KIND
>+        ($d, undef, $props) = $self->get_dir2($dir, $r, $kind, $pool);
>+    } else {
>+        ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);
>+    }
>     my %dirents = map { $_ => { kind => $d->{$_}->kind } } keys %$d;
>     $pool->clear;
>     if ($r != $cache->{r}) {
>-- 
>EW
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-11-02 23:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-31 10:15 [PATCH] git-svn: use SVN::Ra::get_dir2 when possible Eric Wong
2014-10-31 10:34 ` [PATCH v2] " Eric Wong
2014-10-31 19:08   ` Eric Wong
2014-11-02 12:31 ` [PATCH] " Hin-Tak Leung
2014-11-02 23:04   ` Eric Wong
  -- strict thread matches above, loose matches on Subject: below --
2014-10-31 21:09 [PATCH v2] " Hin-Tak Leung
2014-10-31 21:42 ` Eric Wong
2014-10-31 21:53 Hin-Tak Leung
2014-10-31 23:22 ` Eric Wong
2014-11-01  2:19   ` Hin-Tak Leung
2014-11-01  3:13     ` Eric Wong
2014-11-01  6:13       ` Hin-Tak Leung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox