git-svn: save paths to tags/branches with for future reuse
Signed-off-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
parent
d8115c5104
commit
88cf4107eb
13
git-svn.perl
13
git-svn.perl
@ -469,6 +469,8 @@ sub complete_url_ls_init {
|
|||||||
my $r = defined $_revision ? $_revision : $ra->get_latest_revnum;
|
my $r = defined $_revision ? $_revision : $ra->get_latest_revnum;
|
||||||
my ($dirent, undef, undef) = $ra->get_dir($repo_path, $r);
|
my ($dirent, undef, undef) = $ra->get_dir($repo_path, $r);
|
||||||
my $url = $ra->{url};
|
my $url = $ra->{url};
|
||||||
|
my $remote_id;
|
||||||
|
my $remote_path;
|
||||||
foreach my $d (sort keys %$dirent) {
|
foreach my $d (sort keys %$dirent) {
|
||||||
next if ($dirent->{$d}->kind != $SVN::Node::dir);
|
next if ($dirent->{$d}->kind != $SVN::Node::dir);
|
||||||
my $path = "$repo_path/$d";
|
my $path = "$repo_path/$d";
|
||||||
@ -477,8 +479,17 @@ sub complete_url_ls_init {
|
|||||||
# don't try to init already existing refs
|
# don't try to init already existing refs
|
||||||
unless ($gs) {
|
unless ($gs) {
|
||||||
print "init $url/$path => $ref\n";
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user