aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-10-11 11:53:21 -0700
committerJunio C Hamano <junkio@cox.net>2006-10-11 14:41:11 -0700
commitc35b96e7851e417a24c1e255e353c67b31955466 (patch)
treea101f4d97f5ad34d2aa890f3f74b445d9877b2dd /git-svn.perl
parent9ac13ec941933c32849c2284b5d79ef608023a56 (diff)
downloadgit-c35b96e7851e417a24c1e255e353c67b31955466.tar.gz
git-c35b96e7851e417a24c1e255e353c67b31955466.tar.xz
git-svn: multi-init saves and reuses --tags and --branches arguments
This should make it much easier to track newly added tags and branches. Re-running multi-init without command-line arguments should now detect new-tags and branches. --trunk shouldn't change often, but running multi-init on it is now idempotent. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl18
1 files changed, 14 insertions, 4 deletions
diff --git a/git-svn.perl b/git-svn.perl
index f5c7d4634..5a6c87e61 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -682,12 +682,17 @@ sub multi_init {
}
$_trunk = $url . $_trunk;
}
+ my $ch_id;
if ($GIT_SVN eq 'git-svn') {
- print "GIT_SVN_ID set to 'trunk' for $_trunk\n";
+ $ch_id = 1;
$GIT_SVN = $ENV{GIT_SVN_ID} = 'trunk';
}
init_vars();
- init($_trunk);
+ unless (-d $GIT_SVN_DIR) {
+ print "GIT_SVN_ID set to 'trunk' for $_trunk\n" if $ch_id;
+ init($_trunk);
+ sys('git-repo-config', 'svn.trunk', $_trunk);
+ }
complete_url_ls_init($url, $_branches, '--branches/-b', '');
complete_url_ls_init($url, $_tags, '--tags/-t', 'tags/');
}
@@ -937,16 +942,21 @@ sub complete_url_ls_init {
print STDERR "W: Unrecognized URL: $u\n";
die "This should never happen\n";
}
+ # don't try to init already existing refs
my $id = $pfx.$1;
- print "init $u => $id\n";
$GIT_SVN = $ENV{GIT_SVN_ID} = $id;
init_vars();
- init($u);
+ unless (-d $GIT_SVN_DIR) {
+ print "init $u => $id\n";
+ init($u);
+ }
}
exit 0;
}
waitpid $pid, 0;
croak $? if $?;
+ my ($n) = ($switch =~ /^--(\w+)/);
+ sys('git-repo-config', "svn.$n", $var);
}
sub common_prefix {