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

Junio C Hamano committed Oct 18, 2017 at 11:57 UTC 2c210db464ce97f0c635a516fa8a0d5fd43f3a73
1 file changed +13 -2
cook
+13 -2
@@ -547,20 +547,31 @@ sub topic_in_pu {
547 return 0;
548 }
549
550 +my $mergetomaster;
551 +
552 sub tweak_willdo {
553 my ($td) = @_;
554 my $desc = $td->{'desc'};
555 my $text = $td->{'text'};
556
557 + if (!defined $mergetomaster) {
558 + my $master = `git describe master`;
559 + if ($master =~ /-rc\d+(-\d+-g[0-9a-f]+)?$/) {
560 + $mergetomaster = "Will cook in 'next'.";
561 + } else {
562 + $mergetomaster = "Will merge to 'master'.";
563 + }
564 + }
565 +
566 # If updated description (i.e. the list of patches with
567 # merge trail to 'next') has 'merged to next', then
568 # tweak the topic to be slated to 'master'.
569 # NEEDSWORK: does this work correctly for a half-merged topic?
570 $desc =~ s/\n<<\n.*//s;
571 if ($desc =~ /^ \(merged to 'next'/m) {
561 - $text =~ s/^ Will merge to 'next'\.$/ Will merge to 'master'./m;
572 + $text =~ s/^ Will merge to 'next'\.$/ $mergetomaster/m;
573 $text =~ s/^ Will merge to and then cook in 'next'\.$/ Will cook in 'next'./m;
563 - $text =~ s/^ Will merge to 'next' and then to 'master'\.$/ Will merge to 'master'./m;
574 + $text =~ s/^ Will merge to 'next' and then to 'master'\.$/ $mergetomaster/m;
575 }
576 $td->{'text'} = $text;
577 }