]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Control.pm
reopen bugs properly
[debbugs.git] / Debbugs / Control.pm
index e5a1dd24b2d0ce8e05d2dbec026574dba02d3b96..cec80f9b78ec648eac7a64f44b1133f852be13cd 100644 (file)
@@ -897,6 +897,24 @@ sub set_done {
                $warn_fixed = 0;
            }
        }
+       $action = "Bug reopened";
+       for my $data (@data) {
+           my $old_data = dclone($data);
+           $data->{done} = '';
+           append_action_to_log(bug => $data->{bug_num},
+                                command => 'done',
+                                new_data => $data,
+                                old_data => $old_data,
+                                get_lock => 0,
+                                __return_append_to_log_options(
+                                                               %param,
+                                                               action => $action,
+                                                              ),
+                               )
+               if not exists $param{append_log} or $param{append_log};
+           writebug($data->{bug_num},$data);
+       }
+       print {$transcript} "$action\n";
        __end_control(%info);
        if (exists $param{submitter}) {
            set_submitter(bug => $param{bug},
@@ -921,6 +939,15 @@ sub set_done {
        my %submitter_notified;
        my $requester_notified = 0;
        my $orig_report_set = 0;
+       for my $data (@data) {
+           if (exists $data->{done} and
+               defined $data->{done} and
+               length $data->{done}) {
+               print {$transcript} "Bug $data->{bug_num} is already marked as done; not doing anything.\n";
+               __end_control(%info);
+               return;
+           }
+       }
        for my $data (@data) {
            my $old_data = dclone($data);
            my $hash = get_hashname($data->{bug_num});
@@ -939,13 +966,6 @@ sub set_done {
                $orig_report_set = 1;
            }
 
-           if (exists $data->{done} and
-               defined $data->{done} and
-               length $data->{done}) {
-               print {$transcript} "Bug $data->{bug_num} is already marked as done; not doing anything.\n";
-               __end_control(%info);
-               return;
-           }
            $action = "Marked $config{bug} as done";
 
            # set done to the requester
@@ -962,6 +982,7 @@ sub set_done {
                                )
                if not exists $param{append_log} or $param{append_log};
            writebug($data->{bug_num},$data);
+           print {$transcript} "$action\n";
            # get the original report
            if ($param{notify_submitter}) {
                my $submitter_message;
@@ -1010,6 +1031,7 @@ sub set_done {
                                    );
            }
        }
+       __end_control(%info);
        if (exists $param{fixed}) {
            set_fixed(fixed => $param{fixed},
                      bug => $param{bug},