Skip to content

Commit

Permalink
git-svn: sort svk merge tickets to account for minimal parents
Browse files Browse the repository at this point in the history
When merging branches based on svk:merge properties, a single merge
can have updated or added multiple svk:merge lines.  Attempt to
include the minimal set of parents by sorting the merge properties in
order of revision, highest to lowest.

Signed-off-by: Alex Vandiver <alex@chmrr.net>
Acked-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
  • Loading branch information
Alex Vandiver authored and Eric Wong committed Dec 8, 2009
1 parent 9a424b2 commit e9e4c8b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2940,10 +2940,14 @@ sub find_extra_svk_parents {
if ( my $commit = $gs->rev_map_get($rev, $uuid) ) {
# wahey! we found it, but it might be
# an old one (!)
push @known_parents, $commit;
push @known_parents, [ $rev, $commit ];
}
}
}
# Ordering matters; highest-numbered commit merge tickets
# first, as they may account for later merge ticket additions
# or changes.
@known_parents = map {$_->[1]} sort {$b->[0] <=> $a->[0]} @known_parents;
for my $parent ( @known_parents ) {
my @cmd = ('rev-list', $parent, map { "^$_" } @$parents );
my ($msg_fh, $ctx) = command_output_pipe(@cmd);
Expand Down

0 comments on commit e9e4c8b

Please sign in to comment.