summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorLibravatar Eric Wong <normalperson@yhbt.net>2007-02-01 03:59:07 -0800
committerLibravatar Eric Wong <normalperson@yhbt.net>2007-02-23 00:57:11 -0800
commit88cf4107eb70cdcdc226f2385a3ee54fb428c41d (patch)
tree76215e69157faf12cfa520361433f180549183db /git-svn.perl
parentgit-svn: don't write to the config file from --follow-parent (diff)
downloadtgif-88cf4107eb70cdcdc226f2385a3ee54fb428c41d.tar.xz
git-svn: save paths to tags/branches with for future reuse
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl13
1 files changed, 12 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index a2db73fe00..ad2ef53f8d 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -469,6 +469,8 @@ sub complete_url_ls_init {
my $r = defined $_revision ? $_revision : $ra->get_latest_revnum;
my ($dirent, undef, undef) = $ra->get_dir($repo_path, $r);
my $url = $ra->{url};
+ my $remote_id;
+ my $remote_path;
foreach my $d (sort keys %$dirent) {
next if ($dirent->{$d}->kind != $SVN::Node::dir);
my $path = "$repo_path/$d";
@@ -477,8 +479,17 @@ sub complete_url_ls_init {
# don't try to init already existing refs
unless ($gs) {
print "init $url/$path => $ref\n";
- Git::SVN->init($url, $path, undef, $ref);
+ $gs = Git::SVN->init($url, $path, undef, $ref);
}
+ $remote_id ||= $gs->{repo_id} if $gs;
+ }
+ if (defined $remote_id) {
+ $remote_path = "$ra->{svn_path}/$repo_path/*";
+ $remote_path =~ s#/+#/#g;
+ $remote_path =~ s#^/##g;
+ my ($n) = ($switch =~ /^--(\w+)/);
+ command_noisy('config', "svn-remote.$remote_id.$n",
+ $remote_path);
}
}