diff options
author | Eric Wong <normalperson@yhbt.net> | 2007-02-09 01:28:30 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2007-02-23 00:57:11 -0800 |
commit | b9dffd8cad737a07d6a05503318c6746ac593f9c (patch) | |
tree | 735ee41949d15fb6b0d42b13a90e6834dbe800f9 /git-svn.perl | |
parent | e518192f3be92097ba550098dbb69d769ca18429 (diff) | |
download | git-b9dffd8cad737a07d6a05503318c6746ac593f9c.tar.gz |
git-svn: --follow-parent tracks multi-parent paths
We can have a branch that was deleted, then re-added under the
same name but copied from another path, in which case we'll have
multiple parents (we don't want to break the original ref, nor
lose copypath info).
Add a test for this, too, of course.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-x | git-svn.perl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/git-svn.perl b/git-svn.perl index 21d53054f6..cd35efec7e 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -1266,11 +1266,19 @@ sub do_fetch { my ($self, $paths, $rev) = @_; my $ed; my ($last_rev, @parents); - if ($self->last_commit) { + if (my $lc = $self->last_commit) { + # we can have a branch that was deleted, then re-added + # under the same name but copied from another path, in + # which case we'll have multiple parents (we don't + # want to break the original ref, nor lose copypath info): + if (my $log_entry = $self->find_parent_branch($paths, $rev)) { + push @{$log_entry->{parents}}, $lc; + return $log_entry; + } $ed = SVN::Git::Fetcher->new($self); $last_rev = $self->{last_rev}; - $ed->{c} = $self->{last_commit}; - @parents = ($self->{last_commit}); + $ed->{c} = $lc; + @parents = ($lc); } else { $last_rev = $rev; if (my $log_entry = $self->find_parent_branch($paths, $rev)) { |