git-svn: sort svk merge tickets to account for minimal parents
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>
Alex Vandiver committed
Nov 29, 2009 at 02:20 UTC
e9e4c8b7473f6ee21f452c66430a0763681243d7
1 file changed
+5
-1
git-svn.perl
+5
-1
@@ -2940,10 +2940,14 @@ sub find_extra_svk_parents {
2940
if ( my $commit = $gs->rev_map_get($rev, $uuid) ) {
2941
# wahey! we found it, but it might be
2942
# an old one (!)
2943
- push @known_parents, $commit;
2943
+ push @known_parents, [ $rev, $commit ];
2944
}
2945
}
2946
}
2947
+ # Ordering matters; highest-numbered commit merge tickets
2948
+ # first, as they may account for later merge ticket additions
2949
+ # or changes.
2950
+ @known_parents = map {$_->[1]} sort {$b->[0] <=> $a->[0]} @known_parents;
2951
for my $parent ( @known_parents ) {
2952
my @cmd = ('rev-list', $parent, map { "^$_" } @$parents );
2953
my ($msg_fh, $ctx) = command_output_pipe(@cmd);