summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorAlex Vandiver <alex@chmrr.net>2009-11-29 07:20:21 (GMT)
committerEric Wong <normalperson@yhbt.net>2009-12-08 04:25:40 (GMT)
commite9e4c8b7473f6ee21f452c66430a0763681243d7 (patch)
treeafe4839ee21aaaa7cf91d1446f6908480e93a2b2 /git-svn.perl
parent9a424b276c409a3510e7735b6ecc012f50dc2a49 (diff)
downloadgit-e9e4c8b7473f6ee21f452c66430a0763681243d7.zip
git-e9e4c8b7473f6ee21f452c66430a0763681243d7.tar.gz
git-e9e4c8b7473f6ee21f452c66430a0763681243d7.tar.bz2
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>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 957d44e..51f03ad 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -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);