Include name of SVN tree in filename of temporary data to allow concurrent updates...
authorAndreas Oberritter <obi@saftware.de>
Thu, 18 Jun 2009 19:04:47 +0000 (18 21:04 +0200)
committerLove Hörnquist Åstrand <lha@kth.se>
Fri, 19 Jun 2009 15:33:21 +0000 (19 08:33 -0700)
Sign-off-by: Love Hornquist Astrand <lha@kth.se>
git2svn

diff --git a/git2svn b/git2svn
index 3a5677d..7a43e8e 100755 (executable)
--- a/git2svn
+++ b/git2svn
@@ -212,13 +212,18 @@ mkdir ".data" unless (-d ".data");
 die "cant find branch name" unless ($branch =~ m@/?([^/]+)$@);
 my $shortbranch = $1;
 
-my $gitdump = ".data/git.dump-${shortbranch}";
-my $svndump = ".data/svn.dump-${shortbranch}";
-my $log = ".data/log-${shortbranch}";
-
 my $gittree = $ARGV[0];
 $svntree = $ARGV[1];
 
+# create an identifier by replacing path separators
+# (i.e. "/", ":" and "\") with underscores
+my $svntree_id = $svntree;
+$svntree_id =~ s/[\/:\\]/_/g;
+
+my $gitdump = ".data/git.dump-${svntree_id}-${shortbranch}";
+my $svndump = ".data/svn.dump-${svntree_id}-${shortbranch}";
+my $log = ".data/log-${svntree_id}-${shortbranch}";
+
 parse_git_tree($gittree, $branch, $shortbranch);
 
 my $cwd = `pwd`;