Skip to content

Commit e544875

Browse files
committed
Meta/cook: fix recent breakage of the listing
Recent addition of "source:" support broke listing of topics in other sections. Those that have wildo keywords were flushing too soon, before the sources were read.
1 parent a46c71d commit e544875

File tree

1 file changed

+23
-33
lines changed

1 file changed

+23
-33
lines changed

cook

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -834,31 +834,16 @@ sub merge_cooking {
834834
################################################################
835835
# WilDo
836836
sub wildo_queue {
837-
my ($what, $action, $topic) = @_;
838-
if (!exists $what->{$action}) {
839-
$what->{$action} = [];
840-
}
841-
push @{$what->{$action}}, $topic;
842-
}
843-
844-
sub section_action {
845-
my ($section) = @_;
846-
if ($section) {
847-
for ($section) {
848-
return if (/^Graduated to/ || /^Discarded$/);
849-
return $_ if (/^Stalled$/);
850-
}
851-
}
852-
return "Undecided";
853-
}
854-
855-
sub wildo_flush_topic {
856837
my ($in_section, $what, $topic) = @_;
857838
if (defined $topic) {
858-
my $action = section_action($in_section);
859-
if ($action) {
860-
wildo_queue($what, $action, $topic);
839+
for ($in_section) {
840+
return if (/^Graduated to/ || /^Discarded$/);
861841
}
842+
my $action = $topic->[6] || "Under discussion";
843+
if (!exists $what->{$action}) {
844+
$what->{$action} = [];
845+
}
846+
push @{$what->{$action}}, $topic;
862847
}
863848
}
864849

@@ -883,16 +868,22 @@ sub wildo {
883868
if (/^\[(.*)\]$/) {
884869
my $old_section = $in_section;
885870
$in_section = $1;
886-
wildo_flush_topic($old_section, \%what, $topic);
871+
wildo_queue($old_section, \%what, $topic);
887872
$topic = $in_desc = undef;
888873
next;
889874
}
890875

891876
if (/^\* (\S+) \(([-0-9]+)\) (\d+) commits?$/) {
892-
wildo_flush_topic($in_section, \%what, $topic);
893-
894-
# tip-date, next-date, topic, count, seen-count
895-
$topic = [$2, $too_recent, $1, $3, 0];
877+
wildo_queue($in_section, \%what, $topic);
878+
879+
# [0] tip-date
880+
# [1] next-date
881+
# [2] topic
882+
# [3] count
883+
# [4] seen-count
884+
# [5] source
885+
# [6] action
886+
$topic = [$2, $too_recent, $1, $3, 0, [], undef];
896887
$in_desc = undef;
897888
next;
898889
}
@@ -922,19 +913,18 @@ sub wildo {
922913
}
923914

924915
if (wildo_match($_)) {
925-
wildo_queue(\%what, $_, $topic);
916+
$topic->[6] = $_;
926917
next;
927918
}
928919

929-
if (/^source:\s+(.*)$/) {
920+
if (/^(?:source:|cf\.)\s+(.*)$/) {
930921
$topic->[5] ||= [];
931922
push @{$topic->[5]}, $1;
932-
$topic = $in_desc = undef;
933923
next;
934924
}
935925

936926
}
937-
wildo_flush_topic($in_section, \%what, $topic);
927+
wildo_queue($in_section, \%what, $topic);
938928

939929
my $ipbl = "";
940930
for my $what (sort keys %what) {
@@ -954,12 +944,12 @@ sub wildo {
954944
}
955945
$count = "#$count";
956946
printf " %s %-60s %s%s %5s\n", $sign, $name, $tip, $next, $count;
957-
if ($what !~ /^Will /) {
947+
if ($what !~ /^Will merge to '\w+'\.$/) {
958948
for my $s (@$source) {
959949
if ($s =~ /^<(.*)>$/) {
960950
$s = "https://lore.kernel.org/git/$1/";
961951
}
962-
printf " $s\n";
952+
printf " $s\n";
963953
}
964954
}
965955
}

0 commit comments

Comments
 (0)