Skip to contentSkip to conversation

git-svn: use SVN::Ra::get_dir2 when possible

PATCH Hin-Tak Leung 2 participants 5 messages Jun 15, 2016

lore
Share & tools
lore

Hin-Tak Leung

author Tested-by
#0 lore raw

-------------------------

Quoted 5 lines · 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

Quoted 8 lines

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

ref: <[email protected]>
ref: <[email protected]>

Cc Hin-Tak Leung <[email protected]>

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?

Quoted 33 lines

---
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(-)
perl/Git/SVN/Ra.pm +11 -1
index 82d6108..496f430 100644
@@ -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}) {
Signature · 1 line
EW
#1 lore raw
Quoted 11 lines · Hin-Tak Leung

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.

Junio already pulled all of those git-svn patches into git 2.2.0-rc0:

http://mid.gmane.org/[email protected]

Can you give that a try? I've been able to complete the vbox fetch without problems.

Quoted 2 lines

But you are saying that git-svn on debian as shipped exhibit this problem?

No, I'm saying unrelated, (old) functionality such as "git svn show-ignore" also got broken by this SVN bug.

#2 lore raw

--------------------------------------------
On Sat, 1/11/14, Eric Wong <[email protected]> wrote:

Hin-Tak Leung <[email protected]>

Quoted 3 lines · wrote:
Quoted 1 line

Okay, this one on

top of my "git 2.1.0 + 10 recent git svn improvement patches"

Quoted 1 line

allow me to fetch

further.

Quoted 2 lines

I

suspect the problem must be elsewhere though, and this just band-aided

Quoted 3 lines

over it.

For me, reverting

the additional patches and just use git 2.1.0 also allow

Quoted 1 line

me to fetch further, so the problem appear

to me to be associated with

Quoted 1 line

the

additional patches.

Quoted 1 line

Junio

already pulled all of those git-svn patches into git 2.2.0-rc0:

Quoted 3 lines

http://mid.gmane.org/[email protected]

Can you give that a try?

I've been able to complete the vbox
fetch without problems.

While my 2.10 + 11 patches continue to fetch, where it was stuck, now it does "Couldn't find revmap..." - also, the single branch clone is doing the 'trunk/branches/... thing - are these supposed to happen?

--stdlayout:

$ git svn fetch --all
Index mismatch: d6c75bc195b1daad647322e2cc025bd31265c6b9 != 3927d05f6ab037fcf2b4d964c9633efade037d1b
rereading a65b5fc0077c2fa80a344833b65ac19ff4ae88b6
	M	src/VBox/Main/HostImpl.cpp
Checking svn:mergeinfo changes since r28923: 1 sources, 1 changed
Couldn't find revmap for http://www.virtualbox.org/svn/vbox/branches/VBox-3.0
r28924 = 4e01065451e00c725c88113584461ee3284e3952 (refs/remotes/origin/trunk)

without --stdlayout:

$ git svn fetch --all
Index mismatch: d6c75bc195b1daad647322e2cc025bd31265c6b9 != 3927d05f6ab037fcf2b4d964c9633efade037d1b
rereading a65b5fc0077c2fa80a344833b65ac19ff4ae88b6
	M	src/VBox/Main/HostImpl.cpp
Checking svn:mergeinfo changes since r28923: 1 sources, 1 changed
Couldn't find revmap for http://www.virtualbox.org/svn/vbox/trunk/branches/VBox-3.0
r28924 = 4e01065451e00c725c88113584461ee3284e3952 (refs/remotes/git-svn)
#3 lore raw
Quoted 3 lines · Hin-Tak Leung

While my 2.10 + 11 patches continue to fetch, where it was stuck, now it does "Couldn't find revmap..." - also, the single branch clone is doing the 'trunk/branches/... thing - are these supposed to happen?

I'm afraid this is a problem with the vbox repo not publishing anything but trunk, but their svn:mergeinfo refers to non-public branches.

This shows only changes to trunk:

svn log -v http://www.virtualbox.org/svn/vbox

I do not know what their development process is like. From the looks of it, every change is made by a "vboxsync" user. I suspect that's driven by an automated export script, and the real development happens in a different (private) repo...

#4 lore raw

--------------------------------------------
On Sat, 1/11/14, Eric Wong <[email protected]> wrote:

Hin-Tak Leung <[email protected]>

Quoted 1 line · wrote:
Quoted 1 line

While my 2.10 + 11 patches

continue to fetch, where it was stuck, now

Quoted 1 line

it does "Couldn't find

revmap..." - also, the single branch clone is doing

Quoted 1 line

the 'trunk/branches/... thing - are

these supposed to happen?

Quoted 1 line

I'm afraid this is a problem with the vbox

repo not publishing anything
but trunk, but
their svn:mergeinfo refers to non-public branches.

Quoted 1 line

This shows only changes to

trunk:

Quoted 3 lines

    svn log -v http://www.virtualbox.org/svn/vbox

I do not know what their

development process is like.  From the looks of
it, every change is made by a
"vboxsync" user.  I suspect that's driven
by an automated export script, and the real
development happens in a
different (private)
repo...

They are Sun/Oracle technology so have that sort of style, I think. (Think Java and everything to do with Java).

I did get a bit confused about that - their web code broswing interface shows a number of merges and deleted branches.