@matheusbsbs / matheus-bagliano / commits / 88cf4107eb
Fork 0

git-svn: save paths to tags/branches with for future reuse

Signed-off-by: Eric Wong <normalperson@yhbt.net>

Eric Wong committed Feb 1, 2007 at 03:59 UTC 88cf4107eb70cdcdc226f2385a3ee54fb428c41d
1 file changed +12 -1
git-svn.perl
+12 -1
@@ -469,6 +469,8 @@ sub complete_url_ls_init {
469 my $r = defined $_revision ? $_revision : $ra->get_latest_revnum;
470 my ($dirent, undef, undef) = $ra->get_dir($repo_path, $r);
471 my $url = $ra->{url};
472 + my $remote_id;
473 + my $remote_path;
474 foreach my $d (sort keys %$dirent) {
475 next if ($dirent->{$d}->kind != $SVN::Node::dir);
476 my $path = "$repo_path/$d";
@@ -477,8 +479,17 @@ sub complete_url_ls_init {
479 # don't try to init already existing refs
480 unless ($gs) {
481 print "init $url/$path => $ref\n";
480 - Git::SVN->init($url, $path, undef, $ref);
482 + $gs = Git::SVN->init($url, $path, undef, $ref);
483 }
484 + $remote_id ||= $gs->{repo_id} if $gs;
485 + }
486 + if (defined $remote_id) {
487 + $remote_path = "$ra->{svn_path}/$repo_path/*";
488 + $remote_path =~ s#/+#/#g;
489 + $remote_path =~ s#^/##g;
490 + my ($n) = ($switch =~ /^--(\w+)/);
491 + command_noisy('config', "svn-remote.$remote_id.$n",
492 + $remote_path);
493 }
494 }
495