{"thread":{"id":"37855","subject":"[PATCH] git-svn: use SVN::Ra::get_dir2 when possible","startedAt":"2014-10-31T10:15:36Z","lastAt":"2014-11-02T23:04:51Z","messageCount":5,"participants":["Eric Wong","Hin-Tak Leung"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"251262","messageId":"20141031101530.GA29248@dcvr.yhbt.net","threadId":"37855","inReplyTo":null,"subject":"[PATCH] git-svn: use SVN::Ra::get_dir2 when possible","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2014-10-31T10:15:36Z","receivedAt":"2014-10-31T10:15:36Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This avoids the following failure with normal \"get_dir\" on newer\nversions of SVN (tested with SVN 1.8.8-1ubuntu3.1):\n\n  Incorrect parameters given: Could not convert '%ld' into a number\n\nget_dir2 also has the potential to be more efficient by requesting\nless data.\n\nref: <1414636504.45506.YahooMailBasic@web172304.mail.ir2.yahoo.com>\nref: <1414722617.89476.YahooMailBasic@web172305.mail.ir2.yahoo.com>\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\nCc: Hin-Tak Leung <htl10@users.sourceforge.net>\n---\n  This should fix the vbox clone problem.  SVN Perl binding\n  breakage (again :<).  I shall revert the int() changes.\n\n  > I added those two lines to my git and there is no improvement. It\n  > still won't svn fetch the next revision. I think it may be\n  > important/interesting to find out when or how it becomes non-int, so\n  > I have tar'gz'ed my wont-fetch virtual box .git and in the middle of\n  > uploading here: \n  >\n  > http://sourceforge.net/projects/outmodedbonsai/files/R/\n\n  > I am also uploading my old R clone also - maybe you'd like to see\n  > why its .git/svn/.caches is so big compared to a recent one,\n\n  Jakob's changes causes different access patterns, so it's expected the\n  sizes vary.  I also changed the cherry pick cache and removed the\n  _rev_list caching entirely, so it should be much smaller now.\n\n  > as well as how and why there were an extra merge and two missing\n  > merges compared to a recent clone?\n\n  The different merges are fine, I think, as stated in\n    http://mid.gmane.org/20141030230831.GA14160@dcvr.yhbt.net\n\n perl/Git/SVN/Ra.pm | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm\nindex 82d6108..1e52709 100644\n--- a/perl/Git/SVN/Ra.pm\n+++ b/perl/Git/SVN/Ra.pm\n@@ -177,7 +177,17 @@ sub get_dir {\n \t\t}\n \t}\n \tmy $pool = SVN::Pool->new;\n-\tmy ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);\n+\tmy ($d, undef, $props);\n+\n+\tif (defined &SVN::Ra::get_dir2) { # appeared in SVN 1.4\n+\t\t# n.b. in addition to being potentially more efficient,\n+\t\t# this works around what appears to be a bug in some\n+\t\t# SVN 1.8 versions\n+\t\tmy $kind = 1; # SVN_DIRENT_KIND\n+\t\t($d, undef, $props) = $self->get_dir2($dir, $r, $kind, $pool);\n+\t} else {\n+\t\t($d, undef, $props) = $self->get_dir($dir, $r, $pool);\n+\t}\n \tmy %dirents = map { $_ => { kind => $d->{$_}->kind } } keys %$d;\n \t$pool->clear;\n \tif ($r != $cache->{r}) {\n-- \nEW\n"},{"id":"251263","messageId":"20141031103403.GA6190@dcvr.yhbt.net","threadId":"37855","inReplyTo":"20141031101530.GA29248@dcvr.yhbt.net","subject":"[PATCH v2] git-svn: use SVN::Ra::get_dir2 when possible","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2014-10-31T10:34:03Z","receivedAt":"2014-10-31T10:34:03Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"This avoids the following failure with normal \"get_dir\" on newer\nversions of SVN (tested with SVN 1.8.8-1ubuntu3.1):\n\n  Incorrect parameters given: Could not convert '%ld' into a number\n\nget_dir2 also has the potential to be more efficient by requesting\nless data.\n\nref: <1414636504.45506.YahooMailBasic@web172304.mail.ir2.yahoo.com>\nref: <1414722617.89476.YahooMailBasic@web172305.mail.ir2.yahoo.com>\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\nCc: Hin-Tak Leung <htl10@users.sourceforge.net>\n---\n Sorry, waaay past my bed time.  This version doesn't infinite loop\n on autoload or older SVN(*) (at least I hope it doesn't)\n\n perl/Git/SVN/Ra.pm | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm\nindex 82d6108..496f430 100644\n--- a/perl/Git/SVN/Ra.pm\n+++ b/perl/Git/SVN/Ra.pm\n@@ -177,7 +177,17 @@ sub get_dir {\n \t\t}\n \t}\n \tmy $pool = SVN::Pool->new;\n-\tmy ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);\n+\tmy ($d, undef, $props);\n+\n+\tif (::compare_svn_version('1.4.0') >= 0) {\n+\t\t# n.b. in addition to being potentially more efficient,\n+\t\t# this works around what appears to be a bug in some\n+\t\t# SVN 1.8 versions\n+\t\tmy $kind = 1; # SVN_DIRENT_KIND\n+\t\t($d, undef, $props) = $self->get_dir2($dir, $r, $kind, $pool);\n+\t} else {\n+\t\t($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool);\n+\t}\n \tmy %dirents = map { $_ => { kind => $d->{$_}->kind } } keys %$d;\n \t$pool->clear;\n \tif ($r != $cache->{r}) {\n-- \nEW\n"},{"id":"251268","messageId":"20141031190805.GA17314@dcvr.yhbt.net","threadId":"37855","inReplyTo":"20141031103403.GA6190@dcvr.yhbt.net","subject":"Re: [PATCH v2] git-svn: use SVN::Ra::get_dir2 when possible","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2014-10-31T19:08:06Z","receivedAt":"2014-10-31T19:08:06Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Eric Wong <normalperson@yhbt.net> wrote:\n> This avoids the following failure with normal \"get_dir\" on newer\n> versions of SVN (tested with SVN 1.8.8-1ubuntu3.1):\n> \n>   Incorrect parameters given: Could not convert '%ld' into a number\n\nFiled a bug in Debian since I hit it in sid, too:\nhttp://bugs.debian.org/767530\n\nThanks all.\n"},{"id":"251291","messageId":"1414931516.94573.YahooMailBasic@web172301.mail.ir2.yahoo.com","threadId":"37855","inReplyTo":"20141031101530.GA29248@dcvr.yhbt.net","subject":"Re: [PATCH] git-svn: use SVN::Ra::get_dir2 when possible","fromName":"Hin-Tak Leung","fromEmail":"htl10@users.sourceforge.net","sentAt":"2014-11-02T12:31:56Z","receivedAt":"2014-11-02T12:31:56Z","isPatch":true,"sender":{"key":"htl10@users.sourceforge.net","avatar":null},"body":"Hmm, I see you are filing the problem against subversion. FWIW,\nI am currently using subversion-perl-1.8.10-1.fc20.x86_64 package on fedora 20.\nI'll possibly think about filing one under redhat's bugzilla and\nlet them take it upward too.\n\n--------------------------------------------\nOn Fri, 31/10/14, Eric Wong <normalperson@yhbt.net> wrote:\n\n This avoids the following failure\n with normal \"get_dir\" on newer\n versions of SVN (tested with SVN 1.8.8-1ubuntu3.1):\n \n   Incorrect parameters given: Could not convert '%ld'\n into a number\n \n get_dir2 also has the potential to be more efficient by\n requesting\n less data.\n \n ref: <1414636504.45506.YahooMailBasic@web172304.mail.ir2.yahoo.com>\n ref: <1414722617.89476.YahooMailBasic@web172305.mail.ir2.yahoo.com>\n \n Signed-off-by: Eric Wong <normalperson@yhbt.net>\n Cc: Hin-Tak Leung <htl10@users.sourceforge.net>\n ---\n   This should fix the vbox clone problem.  SVN\n Perl binding\n   breakage (again :<).  I shall revert the\n int() changes.\n \n   > I added those two lines to my git and there is\n no improvement. It\n   > still won't svn fetch the next revision. I think\n it may be\n   > important/interesting to find out when or how it\n becomes non-int, so\n   > I have tar'gz'ed my wont-fetch virtual box .git\n and in the middle of\n   > uploading here: \n   >\n   > http://sourceforge.net/projects/outmodedbonsai/files/R/\n \n   > I am also uploading my old R clone also - maybe\n you'd like to see\n   > why its .git/svn/.caches is so big compared to a\n recent one,\n \n   Jakob's changes causes different access patterns, so\n it's expected the\n   sizes vary.  I also changed the cherry pick\n cache and removed the\n   _rev_list caching entirely, so it should be much\n smaller now.\n \n   > as well as how and why there were an extra merge\n and two missing\n   > merges compared to a recent clone?\n \n   The different merges are fine, I think, as stated in\n     http://mid.gmane.org/20141030230831.GA14160@dcvr.yhbt.net\n \n  perl/Git/SVN/Ra.pm | 12 +++++++++++-\n  1 file changed, 11 insertions(+), 1 deletion(-)\n \n diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm\n index 82d6108..1e52709 100644\n --- a/perl/Git/SVN/Ra.pm\n +++ b/perl/Git/SVN/Ra.pm\n @@ -177,7 +177,17 @@ sub get_dir {\n          }\n      }\n      my $pool = SVN::Pool->new;\n -    my ($d, undef, $props) =\n $self->SUPER::get_dir($dir, $r, $pool);\n +    my ($d, undef, $props);\n +\n +    if (defined &SVN::Ra::get_dir2) { #\n appeared in SVN 1.4\n +        # n.b. in addition to\n being potentially more efficient,\n +        # this works around\n what appears to be a bug in some\n +        # SVN 1.8 versions\n +        my $kind = 1; #\n SVN_DIRENT_KIND\n +        ($d, undef, $props) =\n $self->get_dir2($dir, $r, $kind, $pool);\n +    } else {\n +        ($d, undef, $props) =\n $self->get_dir($dir, $r, $pool);\n +    }\n      my %dirents = map { $_ => { kind\n => $d->{$_}->kind } } keys %$d;\n      $pool->clear;\n      if ($r != $cache->{r}) {\n -- \n EW\n \n"},{"id":"251295","messageId":"20141102230451.GA18305@dcvr.yhbt.net","threadId":"37855","inReplyTo":"1414931516.94573.YahooMailBasic@web172301.mail.ir2.yahoo.com","subject":"Re: [PATCH] git-svn: use SVN::Ra::get_dir2 when possible","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2014-11-02T23:04:51Z","receivedAt":"2014-11-02T23:04:51Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Hin-Tak Leung <htl10@users.sourceforge.net> wrote:\n> Hmm, I see you are filing the problem against subversion. FWIW,\n> I am currently using subversion-perl-1.8.10-1.fc20.x86_64 package on fedora 20.\n> I'll possibly think about filing one under redhat's bugzilla and\n> let them take it upward too.\n\nThis is another problem with the vbox repository:\n  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767530#10\n\nAnd forwarded upstream:\n  http://mid.gmane.org/20141101182722.GB20951@freya.jamessan.com\n"}]}