X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FStatus.pm;fp=Debbugs%2FStatus.pm;h=4b8d82e828f06687595ea11a45164a4bb907401d;hb=efe616fda98695327e616c7eee81b5afb4fb5b4c;hp=c9f5709265d9ee3f4cc7be86614def9e34e954de;hpb=452b0f878238b59e5c58b6357aea80d4055e25e0;p=debbugs.git diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm index c9f5709..4b8d82e 100644 --- a/Debbugs/Status.pm +++ b/Debbugs/Status.pm @@ -282,6 +282,17 @@ sub read_bug{ $data{archived} = (defined($location) and ($location eq 'archive'))?1:0; $data{bug_num} = $param{bug}; + # mergedwith occasionally is sorted badly. Fix it to always be sorted by <=> + # and not include this bug + if (defined $data{mergedwith} and + $data{mergedwith}) { + $data{mergedwith} = + join(' ', + grep { $_ != $data{bug_num}} + sort { $a <=> $b } + split / /, $data{mergedwith} + ); + } return \%data; } @@ -516,7 +527,10 @@ sub lock_read_all_merged_bugs { # are all merged with eachother # We do a cmp sort instead of an <=> sort here, because that's # what merge does - my $expectmerge= join(' ',grep {$_ != $bug } sort @bugs); + my $expectmerge= + join(' ',grep {$_ != $bug } + sort { $a <=> $b } + @bugs); if ($newdata->{mergedwith} ne $expectmerge) { for (1..$locks) { unfilelock(exists $param{locks}?$param{locks}:());