git-svn.perl: consider all ranges for a given merge, instead of only tip-by-tip

Consider the case where you have trunk, branch1 of trunk, and branch2 of
branch1.  trunk is merged back into branch2, and then branch2 is
reintegrated into trunk.  The merge of branch2 into trunk will have
svn:mergeinfo property references to both branch1 and branch2.  When
git-svn fetches the commit that merges branch2 (check_cherry_pick),
it is necessary to eliminate the merged contents of branch1 as well as
branch2, or else the merge will be incorrectly ignored as a cherry-pick.

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
Reviewed-by: Sam Vilain <sam@vilain.net>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
Steven Walter
2012-08-19 21:39:40 -04:00
committed by Eric Wong
parent f84667def2
commit f271fad266
2 changed files with 63 additions and 5 deletions

View File

@ -1713,14 +1713,14 @@ sub find_extra_svn_parents {
my @merge_tips;
my $url = $self->url;
my $uuid = $self->ra_uuid;
my %ranges;
my @all_ranges;
for my $merge ( @merges ) {
my ($tip_commit, @ranges) =
lookup_svn_merge( $uuid, $url, $merge );
unless (!$tip_commit or
grep { $_ eq $tip_commit } @$parents ) {
push @merge_tips, $tip_commit;
$ranges{$tip_commit} = \@ranges;
push @all_ranges, @ranges;
} else {
push @merge_tips, undef;
}
@ -1735,8 +1735,6 @@ sub find_extra_svn_parents {
my $spec = shift @merges;
next unless $merge_tip and $excluded{$merge_tip};
my $ranges = $ranges{$merge_tip};
# check out 'new' tips
my $merge_base;
eval {
@ -1758,7 +1756,7 @@ sub find_extra_svn_parents {
my (@incomplete) = check_cherry_pick(
$merge_base, $merge_tip,
$parents,
@$ranges,
@all_ranges,
);
if ( @incomplete ) {