Skip to content

Commit 1ca7558

Browse files
Eric WongJunio C Hamano
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4511c89 commit 1ca7558

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

git-svn.perl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ sub nag_lib {
124124
'no-graft-copy' => \$_no_graft_copy } ],
125125
'multi-init' => [ \&multi_init,
126126
'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+
} ],
128133
'multi-fetch' => [ \&multi_fetch,
129134
'Fetch multiple trees (like git-svnimport)',
130135
\%fc_opts ],
@@ -3316,11 +3321,11 @@ sub libsvn_commit_cb {
33163321

33173322
sub libsvn_ls_fullurl {
33183323
my $fullurl = shift;
3319-
$SVN ||= libsvn_connect($fullurl);
3324+
my $ra = libsvn_connect($fullurl);
33203325
my @ret;
33213326
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);
33243329
foreach my $d (keys %$dirent) {
33253330
if ($dirent->{$d}->kind == $SVN::Node::dir) {
33263331
push @ret, "$d/"; # add '/' for compat with cli svn

0 commit comments

Comments
 (0)