aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-23 19:14:13 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-23 19:14:13 -0800
commitd43c07b8ee6684a0df8636a0c849605f0ffc066f (patch)
treec449f4363cd3daad2a03712dd19d3ee94e038553 /git-svn.perl
parentb4b0ba06f8748348039d56ffa5890590dd9776ee (diff)
parent0df84059d4127ed06e040998ec0e6ce6f61d3d1f (diff)
downloadgit-d43c07b8ee6684a0df8636a0c849605f0ffc066f.tar.gz
git-d43c07b8ee6684a0df8636a0c849605f0ffc066f.tar.xz
Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn: git-svn: read the dcommit url from the config file on a per remote basis git-svn: fix delete+add branch tracking with empty files git-svn: Create leading directories in create-ignore
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl19
1 files changed, 17 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index cbc5211d5..d8476c81e 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -438,7 +438,17 @@ sub cmd_dcommit {
die "Unable to determine upstream SVN information from ",
"$head history.\nPerhaps the repository is empty.";
}
- $url = defined $_commit_url ? $_commit_url : $gs->full_url;
+
+ if (defined $_commit_url) {
+ $url = $_commit_url;
+ } else {
+ $url = eval { command_oneline('config', '--get',
+ "svn-remote.$gs->{repo_id}.commiturl") };
+ if (!$url) {
+ $url = $gs->full_url
+ }
+ }
+
my $last_rev = $_revision if defined $_revision;
if ($url) {
print "Committing to $url ...\n";
@@ -670,7 +680,11 @@ sub cmd_create_ignore {
$gs->prop_walk($gs->{path}, $r, sub {
my ($gs, $path, $props) = @_;
# $path is of the form /path/to/dir/
- my $ignore = '.' . $path . '.gitignore';
+ $path = '.' . $path;
+ # SVN can have attributes on empty directories,
+ # which git won't track
+ mkpath([$path]) unless -d $path;
+ my $ignore = $path . '.gitignore';
my $s = $props->{'svn:ignore'} or return;
open(GITIGNORE, '>', $ignore)
or fatal("Failed to open `$ignore' for writing: $!");
@@ -2417,6 +2431,7 @@ sub find_parent_branch {
# do_switch works with svn/trunk >= r22312, but that
# is not included with SVN 1.4.3 (the latest version
# at the moment), so we can't rely on it
+ $self->{last_rev} = $r0;
$self->{last_commit} = $parent;
$ed = SVN::Git::Fetcher->new($self, $gs->{path});
$gs->ra->gs_do_switch($r0, $rev, $gs,