push @changed, 'removed blocking bug(s) of '.$data->{bug_num}.': '.english_join([keys %removed_blockers]) if keys %removed_blockers;
$action = ucfirst(join ('; ',@changed)) if @changed;
if (not @changed) {
- print {$transcript} "Ignoring request to alter blocking bugs of bug #$data->{bug_num} to the same blocks previously set\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to alter blocking bugs of bug #$data->{bug_num} to the same blocks previously set\n";
next;
}
$data->{blockedby} = join(' ',keys %blockers);
push @changed, 'removed tag(s) '.english_join([keys %tag_removed]) if keys %tag_removed;
$action = ucfirst(join ('; ',@changed)) if @changed;
if (not @changed) {
- print {$transcript} "Ignoring request to alter tags of bug #$data->{bug_num} to the same tags previously set\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to alter tags of bug #$data->{bug_num} to the same tags previously set\n";
next;
}
$action .= '.';
(not defined $data->{originator} or not length $data->{originator})) or
(defined $param{submitter} and defined $data->{originator} and
$param{submitter} eq $data->{originator})) {
- print {$transcript} "Ignoring request to change the submitter of bug#$data->{bug_num} to the same value\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to change the submitter of bug#$data->{bug_num} to the same value\n";
next;
}
else {
if (__all_undef_or_equal($param{forwarded},$data->{forwarded}) or
(not defined $param{forwarded} and
defined $data->{forwarded} and not length $data->{forwarded})) {
- print {$transcript} "Ignoring request to change the forwarded-to-address of bug#$data->{bug_num} to the same value\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to change the forwarded-to-address of bug#$data->{bug_num} to the same value\n";
next;
}
else {
print {$debug} "Going to change bug title\n";
if (defined $data->{subject} and length($data->{subject}) and
$data->{subject} eq $param{title}) {
- print {$transcript} "Ignoring request to change the title of bug#$data->{bug_num} to the same title\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to change the title of bug#$data->{bug_num} to the same title\n";
next;
}
else {
print {$debug} "Going to change assigned package\n";
if (defined $data->{package} and length($data->{package}) and
$data->{package} eq $new_package) {
- print {$transcript} "Ignoring request to reassign bug #$data->{bug_num} to the same package\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to reassign bug #$data->{bug_num} to the same package\n";
next;
}
else {
if (not @svers) {
@svers = $version;
}
+ else {
+ if (exists $found_versions{$version}) {
+ delete $found_versions{$version};
+ $found_removed{$version} = 1;
+ }
+ }
for my $sver (@svers) {
if (not exists $found_versions{$sver}) {
$found_versions{$sver} = 1;
$action .= " and reopened"
}
if (not $reopened and not @changed) {
- print {$transcript} "Ignoring request to alter found versions of bug #$data->{bug_num} to the same values previously set\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to alter found versions of bug #$data->{bug_num} to the same values previously set\n";
next;
}
$action .= '.';
if (not @svers) {
@svers = $version;
}
+ else {
+ if (exists $fixed_versions{$version}) {
+ $fixed_removed{$version} = 1;
+ delete $fixed_versions{$version};
+ }
+ }
for my $sver (@svers) {
if (not exists $fixed_versions{$sver}) {
$fixed_versions{$sver} = 1;
$action .= " and reopened"
}
if (not $reopened and not @changed) {
- print {$transcript} "Ignoring request to alter fixed versions of bug #$data->{bug_num} to the same values previously set\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to alter fixed versions of bug #$data->{bug_num} to the same values previously set\n";
next;
}
$action .= '.';
# figure out the problems
print {$transcript} "Unable to merge bugs because:\n";
for my $change (@{$disallowed_changes}) {
- print {$transcript} "$change->{field} of #$change->{bug} is '$change->{orig_value}' not '$change->{value}'\n";
+ print {$transcript} "$change->{field} of #$change->{bug} is '$change->{text_orig_value}' not '$change->{text_value}'\n";
}
if ($attempts > 0) {
croak "Some bugs were altered while attempting to merge";
$locks += $n_locks;
%data = %{$data};
@data = values %data;
- ($merge_status,$bugs_to_merge) =
- __calculate_merge_status(\@data,\%data,$param{bug});
+ ($merge_status,$bugs_to_merge) =
+ __calculate_merge_status(\@data,\%data,$param{bug},$merge_status);
($disallowed_changes,$changes) =
__calculate_merge_changes(\@data,$merge_status,\%param);
$attempts = max(values %bug_changed);
sub __allow_relocking{
my ($locks,$bugs) = @_;
- for my $bug (@{$bugs}) {
- my @lockfiles = grep {m{/\Q$bug\E$}} keys %{$locks->{locks}};
+ my @locks = (@{$bugs},'merge');
+ for my $lock (@locks) {
+ my @lockfiles = grep {m{/\Q$lock\E$}} keys %{$locks->{locks}};
next unless @lockfiles;
$locks->{relockable}{$lockfiles[0]} = 0;
}
sub __calculate_merge_status{
- my ($data_a,$data_h,$master_bug,$merge) = @_;
- my %merge_status;
+ my ($data_a,$data_h,$master_bug,$merge_status) = @_;
+ my %merge_status = %{$merge_status // {}};
my %merged_bugs;
my $bugs_to_merge = 0;
for my $data (@{$data_a}) {
$merge_status{$_} = $data->{$_}
}
}
- if (not $merge) {
- next unless $data->{bug_num} == $master_bug;
- }
+ if (defined $merge_status) {
+ next unless $data->{bug_num} == $master_bug;
+ }
$merge_status{tag} = {} if not exists $merge_status{tag};
for my $tag (split /\s+/, $data->{keywords}) {
$merge_status{tag}{$tag} = 1;
function => $force_functions{$field}{func},
key => $force_functions{$field}{key},
options => $force_functions{$field}{options},
- allowed => exists $force_functions{$field}{allowed} ? 0 : $force_functions{$field}{allowed},
+ allowed => exists $force_functions{$field}{allowed} ? $force_functions{$field}{allowed} : 0,
};
- if ($param->{force}) {
- if ($field ne 'package') {
+ $change->{text_value} = ref($change->{func_value}) eq 'ARRAY'?join(' ',@{$change->{func_value}}):$change->{func_value};
+ $change->{text_orig_value} = ref($change->{orig_value}) eq 'ARRAY'?join(' ',@{$change->{orig_value}}):$change->{orig_value};
+ if ($param->{force} or $change->{allowed}) {
+ if ($field ne 'package' or $change->{allowed}) {
push @{$changes{$data->{bug_num}}},$change;
next;
}
}
}
if (not length $action) {
- print {$transcript} "Ignoring request to set affects of bug $data->{bug_num} to the same value previously set\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to set affects of bug $data->{bug_num} to the same value previously set\n";
next;
}
my $old_data = dclone($data);
if (((not defined $summary or not length $summary) and
(not defined $data->{summary} or not length $data->{summary})) or
$summary eq $data->{summary}) {
- print {$transcript} "Ignoring request to change the summary of bug $param{bug} to the same value\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to change the summary of bug $param{bug} to the same value\n";
next;
}
if (length $summary) {
print {$debug} "Owner is currently '$data->{owner}' for bug $data->{bug_num}\n";
if (not defined $param{owner} or not length $param{owner}) {
if (not defined $data->{owner} or not length $data->{owner}) {
- print {$transcript} "Ignoring request to unset the owner of bug #$data->{bug_num} which was not set\n"
- unless __internal_request();
+ print {$transcript} "Ignoring request to unset the owner of bug #$data->{bug_num} which was not set\n";
next;
}
$param{owner} = '';
print {$transcript} "Bug $param{bug} cannot be archived\n";
die "Bug $param{bug} cannot be archived";
}
- print {$debug} "$param{bug} considering\n";
if (not $param{archive_unarchived} and
not exists $data[0]{unarchived}
) {
);
my $new_locks;
my ($debug,$transcript) = __handle_debug_transcript(@_);
- print {$debug} "$param{bug} considering\n";
+ print {$debug} "considering bug $param{bug} for ".(exists $param{command}?$param{command}:scalar caller())."\n";
+# print {$debug} Data::Dumper->Dump([[caller(1)],\%param],[qw(caller param)])."\n";
$lockhash = $param{locks} if exists $param{locks};
my @data = ();
my $old_die = $SIG{__DIE__};