Skip to content

Commit e9e4c8b

Browse files
alexmvEric Wong
authored andcommitted
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 <[email protected]> Acked-by: Sam Vilain <[email protected]> Acked-by: Eric Wong <[email protected]>
1 parent 9a424b2 commit e9e4c8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

git-svn.perl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2940,10 +2940,14 @@ sub find_extra_svk_parents {
29402940
if ( my $commit = $gs->rev_map_get($rev, $uuid) ) {
29412941
# wahey! we found it, but it might be
29422942
# an old one (!)
2943-
push @known_parents, $commit;
2943+
push @known_parents, [ $rev, $commit ];
29442944
}
29452945
}
29462946
}
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;
29472951
for my $parent ( @known_parents ) {
29482952
my @cmd = ('rev-list', $parent, map { "^$_" } @$parents );
29492953
my ($msg_fh, $ctx) = command_output_pipe(@cmd);

0 commit comments

Comments
 (0)