@matheusbsbs / matheus-bagliano / commits / 1ca7558dd8
Fork 0

git-svn: fix multi-init

After the bugfix to connect to repositories where the user has limited read permissions, multi-init was broken due to our SVN::Ra connection being limited to working in a subdirectory; so we now create a new Ra connection for init-ing branches and another for tags Along with that fix, allow the user to use the command-line option flags for multi-init (--revision being the most notable; but also --no-auth-cache, --config-dir, --username (for passing to SVN), and --shared/--template for passing to git-init-db Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

Eric Wong committed Nov 28, 2006 at 18:51 UTC 1ca7558dd838e82f6f6b8611b981654fa4ecde2b
1 file changed +9 -4
git-svn.perl
+9 -4
@@ -124,7 +124,12 @@ my %cmd = (
124 'no-graft-copy' => \$_no_graft_copy } ],
125 'multi-init' => [ \&multi_init,
126 'Initialize multiple trees (like git-svnimport)',
127 - { %multi_opts, %fc_opts } ],
127 + { %multi_opts, %init_opts,
128 + 'revision|r=i' => \$_revision,
129 + 'username=s' => \$_username,
130 + 'config-dir=s' => \$_config_dir,
131 + 'no-auth-cache' => \$_no_auth_cache,
132 + } ],
133 'multi-fetch' => [ \&multi_fetch,
134 'Fetch multiple trees (like git-svnimport)',
135 \%fc_opts ],
@@ -3316,11 +3321,11 @@ sub libsvn_commit_cb {
3321
3322 sub libsvn_ls_fullurl {
3323 my $fullurl = shift;
3319 - $SVN ||= libsvn_connect($fullurl);
3324 + my $ra = libsvn_connect($fullurl);
3325 my @ret;
3326 my $pool = SVN::Pool->new;
3322 - my ($dirent, undef, undef) = $SVN->get_dir($SVN->{svn_path},
3323 - $SVN->get_latest_revnum, $pool);
3327 + my $r = defined $_revision ? $_revision : $ra->get_latest_revnum;
3328 + my ($dirent, undef, undef) = $ra->get_dir('', $r, $pool);
3329 foreach my $d (keys %$dirent) {
3330 if ($dirent->{$d}->kind == $SVN::Node::dir) {
3331 push @ret, "$d/"; # add '/' for compat with cli svn