summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 42d3287)
raw | patch | inline | side by side (parent: 42d3287)
author | Eric Wong <normalperson@yhbt.net> | |
Thu, 15 Jun 2006 04:24:03 +0000 (21:24 -0700) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Fri, 16 Jun 2006 10:04:20 +0000 (03:04 -0700) |
repo_path_split() is already pretty fast, and is already
optimized via caching.
We also don't need to create an exclude file if we're
relying on the SVN libraries.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
optimized via caching.
We also don't need to create an exclude file if we're
relying on the SVN libraries.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
contrib/git-svn/git-svn.perl | patch | blob | history |
index 884969ebdd5ca3caf34e2b3c28bf86f44467f09f..88af9c570473697bc6970d76aab87628528b52fa 100755 (executable)
close $fh;
s_to_file($SVN_URL,"$GIT_SVN_DIR/info/url");
- open my $fd, '>>', "$GIT_SVN_DIR/info/exclude" or croak $!;
- print $fd '.svn',"\n";
- close $fd or croak $!;
- my ($url, $path) = repo_path_split($SVN_URL);
- s_to_file($url, "$GIT_SVN_DIR/info/repo_url");
- s_to_file($path, "$GIT_SVN_DIR/info/repo_path");
}
sub assert_svn_wc_clean {
sub index_changes {
return if $_use_lib;
+
+ if (!-f "$GIT_SVN_DIR/info/exclude") {
+ open my $fd, '>>', "$GIT_SVN_DIR/info/exclude" or croak $!;
+ print $fd '.svn',"\n";
+ close $fd or croak $!;
+ }
my $no_text_base = shift;
do_update_index([qw/git-diff-files --name-only -z/],
'remove',
my $dn = dirname("$GIT_DIR/svn/$x");
mkpath([$dn]) unless -d $dn;
rename "$GIT_DIR/$x", "$GIT_DIR/svn/$x" or croak "$!: $x";
- my ($url, $path) = repo_path_split($u);
- s_to_file($url, "$GIT_DIR/svn/$x/info/repo_url");
- s_to_file($path, "$GIT_DIR/svn/$x/info/repo_path");
}
migrate_revdb() if (-d $GIT_SVN_DIR && !-w $REVDB);
print "Done upgrading.\n";
sub read_url_paths {
my $l_map = {};
git_svn_each(sub { my $x = shift;
- my $u = file_to_s("$GIT_DIR/svn/$x/info/repo_url");
- my $p = file_to_s("$GIT_DIR/svn/$x/info/repo_path");
- # we hate trailing slashes
- if ($u =~ s#(?:^\/+|\/+$)##g) {
- s_to_file($u,"$GIT_DIR/svn/$x/info/repo_url");
- }
- if ($p =~ s#(?:^\/+|\/+$)##g) {
- s_to_file($p,"$GIT_DIR/svn/$x/info/repo_path");
- }
+ my $url = file_to_s("$GIT_DIR/svn/$x/info/url");
+ my ($u, $p) = repo_path_split($url);
$l_map->{$u}->{$p} = $x;
});
return $l_map;