git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] git-svn: fix multi-init

From
EWEric Wong <normalperson@yhbt.net>
Date
Nov 29, 2006, 02:51 UTC
Message-ID
<1164768705707-git-send-email-normalperson@yhbt.net>
In-Reply-To
<11647687042130-git-send-email-normalperson@yhbt.net>

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>
---
 git-svn.perl |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index d8d8716..3891122 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -124,7 +124,12 @@ my %cmd = (
 			  'no-graft-copy' => \$_no_graft_copy } ],
 	'multi-init' => [ \&multi_init,
 			'Initialize multiple trees (like git-svnimport)',
-			{ %multi_opts, %fc_opts } ],
+			{ %multi_opts, %init_opts,
+			 'revision|r=i' => \$_revision,
+			 'username=s' => \$_username,
+			 'config-dir=s' => \$_config_dir,
+			 'no-auth-cache' => \$_no_auth_cache,
+			} ],
 	'multi-fetch' => [ \&multi_fetch,
 			'Fetch multiple trees (like git-svnimport)',
 			\%fc_opts ],
@@ -3316,11 +3321,11 @@ sub libsvn_commit_cb {
 
 sub libsvn_ls_fullurl {
 	my $fullurl = shift;
-	$SVN ||= libsvn_connect($fullurl);
+	my $ra = libsvn_connect($fullurl);
 	my @ret;
 	my $pool = SVN::Pool->new;
-	my ($dirent, undef, undef) = $SVN->get_dir($SVN->{svn_path},
-						$SVN->get_latest_revnum, $pool);
+	my $r = defined $_revision ? $_revision : $ra->get_latest_revnum;
+	my ($dirent, undef, undef) = $ra->get_dir('', $r, $pool);
 	foreach my $d (keys %$dirent) {
 		if ($dirent->{$d}->kind == $SVN::Node::dir) {
 			push @ret, "$d/"; # add '/' for compat with cli svn
-- 
1.4.4.1.g22a08
Previous: Eric WongNext: Steven Grimm
Message 3 of 11 in “git-svn: color support for the log command”
  1. 1/3 git-svn: color support for the log commandEric Wong, Nov 29, 2006
  2. 2/3 git-svn: documentation updatesEric Wong, Nov 29, 2006
  3. 3/3 git-svn: fix multi-initEric Wong, Nov 29, 2006
  4. Steven GrimmNov 29, 2006
  5. Eric WongNov 29, 2006
  6. PazuNov 29, 2006
  7. Eric WongDec 3, 2006
  8. Junio C HamanoDec 3, 2006
  9. Eric WongDec 3, 2006
  10. Seth FalconNov 29, 2006
  11. Eric WongDec 3, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.