Meta/cook: automate will merge to s/next/master/

Junio C Hamano committed Oct 24, 2014 at 15:27 UTC 5d95246e8ab6088e26f3f2c6b1a3ab10abca78b8
1 file changed +12
cook
+12
@@ -536,6 +536,17 @@ sub topic_in_pu {
536 return 0;
537 }
538
539 +sub tweak_willdo {
540 + my ($td) = @_;
541 + my $desc = $td->{'desc'};
542 + my $text = $td->{'text'};
543 + $desc =~ s/\n<<\n.*//s;
544 + if ($desc =~ /^ \(merged to 'next'/m) {
545 + $text =~ s/^ Will merge to 'next'\.$/ Will merge to 'master'./m;
546 + }
547 + $td->{'text'} = $text;
548 +}
549 +
550 sub merge_cooking {
551 my ($cooking, $current) = @_;
552 my $td = $cooking->{'topic_description'};
@@ -569,6 +580,7 @@ sub merge_cooking {
580 my $o = $td->{$topic}{'desc'};
581 if ($n ne $o) {
582 $td->{$topic}{'desc'} = $n . "\n<<\n" . $o ."\n>>";
583 + tweak_willdo($td->{$topic});
584 }
585 }
586