Meta/cook: hold topics in 'next' by default during -rc period

This commit is contained in:
Junio C Hamano
2017-10-18 11:57:13 +09:00
parent d32db97b02
commit 2c210db464

15
cook
View File

@@ -547,20 +547,31 @@ sub topic_in_pu {
return 0;
}
my $mergetomaster;
sub tweak_willdo {
my ($td) = @_;
my $desc = $td->{'desc'};
my $text = $td->{'text'};
if (!defined $mergetomaster) {
my $master = `git describe master`;
if ($master =~ /-rc\d+(-\d+-g[0-9a-f]+)?$/) {
$mergetomaster = "Will cook in 'next'.";
} else {
$mergetomaster = "Will merge to 'master'.";
}
}
# If updated description (i.e. the list of patches with
# merge trail to 'next') has 'merged to next', then
# tweak the topic to be slated to 'master'.
# NEEDSWORK: does this work correctly for a half-merged topic?
$desc =~ s/\n<<\n.*//s;
if ($desc =~ /^ \(merged to 'next'/m) {
$text =~ s/^ Will merge to 'next'\.$/ Will merge to 'master'./m;
$text =~ s/^ Will merge to 'next'\.$/ $mergetomaster/m;
$text =~ s/^ Will merge to and then cook in 'next'\.$/ Will cook in 'next'./m;
$text =~ s/^ Will merge to 'next' and then to 'master'\.$/ Will merge to 'master'./m;
$text =~ s/^ Will merge to 'next' and then to 'master'\.$/ $mergetomaster/m;
}
$td->{'text'} = $text;
}