Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

56 lines (46 sloc) 1.534 kb
#!/usr/bin/perl -w
use WWW::Mechanize;
use Data::Dumper;
my ($user, $password, $version, $tag) = @ARGV;
my $agent = WWW::Mechanize->new();
$agent->follow_link(text => 'Log In', n => '1');
$agent->tick('Bugzilla_restrictlogin', 'on');
$agent->field('Bugzilla_password', "$password");
$agent->field('Bugzilla_login', "$user");
my @git_log = qx|git log --pretty=format:'%s' $tag..$HEAD|;
my @bugs = ( );
foreach (@git_log) {
if ($_ =~ m/([B|b]ug|BZ)?\s?(?<![a-z]|\.)(\d{4})[\s|:|,]/g) {
# print "$&\n"; # Uncomment this line and the die below to view exact matches
push @bugs, $2;
my @problems;
my $branch = 'rel_3_6';
foreach my $bug (@bugs) {
my $change = 0;
$agent->field('quicksearch', $bug);
my $status = $agent->value('bug_status');
if ($status eq 'Pushed to Master') {
$agent->field('bug_status', 'Pushed to Stable');
$change = 1;
if ($status eq 'RESOLVED' || $status eq 'Pushed to Stable') {
$change = 1;
$agent->field('comment', "This bug will be included in the Koha $version release.");
$change = 0 unless $agent->value('version') eq "$branch";
if ($change) {
print "Changing $bug ($status)\n";
} else {
push @problems, $bug;
print "Bugs to check: @problems\n";
Jump to Line
Something went wrong with that request. Please try again.