]> git.donarmstrong.com Git - debbugs.git/commitdiff
use a cmp sort instead of a <=> sort, because that's what merge does
authorDon Armstrong <don@donarmstrong.com>
Fri, 16 Aug 2013 18:54:28 +0000 (11:54 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 16 Aug 2013 18:54:28 +0000 (11:54 -0700)
Add slightly more useful debugging output when we fail from this error
Fixes #719839

Debbugs/Status.pm

index bf3d2ab7cdbdfa27d25b4d0b7eac3831445af3ef..b28ff5355658e4a24dc17bc29bc06da172334e39 100644 (file)
@@ -512,12 +512,14 @@ sub lock_read_all_merged_bugs {
            push @data,$newdata;
            # perform a sanity check to make sure that the merged bugs
            # are all merged with eachother
-           my $expectmerge= join(' ',grep {$_ != $bug } sort { $a <=> $b } @bugs);
+        # We do a cmp sort instead of an <=> sort here, because that's
+        # what merge does
+           my $expectmerge= join(' ',grep {$_ != $bug } sort @bugs);
            if ($newdata->{mergedwith} ne $expectmerge) {
                for (1..$locks) {
                    unfilelock(exists $param{locks}?$param{locks}:());
                }
-               die "Bug $param{bug} differs from bug $bug: ($newdata->{bug_num}: '$newdata->{mergedwith}') vs. ('$expectmerge') (".join(' ',@bugs).")";
+               die "Bug $param{bug} mergedwith differs from bug $bug: ($newdata->{bug_num}: '$newdata->{mergedwith}') vs. ('$expectmerge') (".join(' ',@bugs).")";
            }
        }
     }