package => [qw(set_package)],
block => [qw(set_blocks)],
merge => [qw(set_merged)],
- tag => [qw(set_tag)],
+ tag => [qw(set_tag valid_usertag)],
clone => [qw(clone_bug)],
archive => [qw(bug_archive bug_unarchive),
],
# blocker
if (keys %bad_blockers and $mode eq 'set') {
__end_control(%info);
- croak "Unknown blocking bug(s):".join(', ',keys %bad_blockers).
- keys %ok_blockers?'':" and no known blocking bug(s)";
+ croak "Unknown/archived blocking bug(s):".join(', ',keys %bad_blockers).
+ keys %ok_blockers?'':" and no good blocking bug(s)";
}
# if there are no ok blockers and we are not setting the blockers,
# there's an error.
print {$transcript} "No valid blocking bug(s) given; not doing anything\n";
if (keys %bad_blockers) {
__end_control(%info);
- croak "Unknown blocking bug(s):".join(', ',keys %bad_blockers);
+ croak "Unknown/archived blocking bug(s):".join(', ',keys %bad_blockers);
}
__end_control(%info);
return;
my @bugs = @{$info{bugs}};
my $action = "$config{bug} unarchived.";
my @files_to_remove;
+ ## error out if we're unarchiving unarchived bugs
+ for my $data (@{$info{data}}) {
+ if (not defined $data->{archived} or
+ not $data->{archived}
+ ) {
+ __end_control(%info);
+ croak("Bug $data->{bug_num} was not archived; not unarchiving it.");
+ }
+ }
for my $bug (@bugs) {
print {$debug} "$param{bug} removing $bug\n";
my $dir = get_hashname($bug);
__end_control(%info);
}
+=head2 valid_usertag
+
+ valid_usertag
+
+This checks if the usertag contains valid characters or not.
+
+=cut
+
+sub valid_usertag {
+ my $usertag = shift;
+ return $usertag =~ m/^[a-zA-Z0-9.+\@-]+$/;
+}
+
+
=head2 append_action_to_log
append_action_to_log