Meta/cook: wildo updates
Junio C Hamano committed
Apr 28, 2011 at 14:52 UTC
ca9220353c8a8c134a41004e026c8321cc8bab71
1 file changed
+33
-9
cook
+33
-9
@@ -590,13 +590,30 @@ sub merge_cooking {
590
591
################################################################
592
# WilDo
593
+sub wildo_queue {
594
+ my ($what, $action, $topic) = @_;
595
+ if (!exists $what->{$action}) {
596
+ $what->{$action} = [];
597
+ }
598
+ push @{$what->{$action}}, $topic;
599
+}
600
+
601
sub wildo {
602
my (%what, $topic, $last_merge_to_next);
603
my $too_recent = '9999-99-99';
604
while (<>) {
605
chomp;
598
- if (/^\* (?:\S+) \(([-0-9]+)\) \d+ commits?$/) {
599
- $topic = [$1, $too_recent, $_]; # tip-date, next-date, line
606
+
607
+ next if (/^\[Graduated to/../^-{20,}$/);
608
+ next if (/^\[Stalled\]/../^-{20,}$/);
609
+ next if (/^\[Discarded\]/../^-{20,}$/);
610
+
611
+ if (/^\* (\S+) \(([-0-9]+)\) (\d+) commits?$/) {
612
+ if (defined $topic) {
613
+ wildo_queue(\%what, "Undecided", $topic);
614
+ }
615
+ # tip-date, next-date, topic, count
616
+ $topic = [$2, $too_recent, $1, $3];
617
}
618
if (defined $topic &&
619
($topic->[1] eq $too_recent) &&
@@ -606,21 +623,28 @@ sub wildo {
623
next if (/^ /);
624
if (defined $topic &&
625
/Will (?:\S+ )?merge /i) {
609
- if (!exists $what{$_}) {
610
- $what{$_} = [];
611
- }
612
- push @{$what{$_}}, $topic;
626
+ wildo_queue(\%what, $_, $topic);
627
$topic = undef;
628
}
629
}
630
my $ipbl = "";
631
for my $what (sort keys %what) {
632
print "$ipbl$what\n";
619
- for $topic (map { $_->[2] }
620
- sort { (($a->[1] cmp $b->[1]) ||
633
+ for $topic (sort { (($a->[1] cmp $b->[1]) ||
634
($a->[0] cmp $b->[0])) }
635
@{$what{$what}}) {
623
- print " $topic\n";
636
+ my ($tip, $next, $name, $count) = @$topic;
637
+ my ($sign);
638
+ $tip =~ s/^\d{4}-//;
639
+ if ($next eq $too_recent) {
640
+ $sign = "-";
641
+ $next = " " x 6;
642
+ } else {
643
+ $sign = "+";
644
+ $next =~ s|^\d{4}-|/|;
645
+ }
646
+ $count = "#$count";
647
+ printf " %s %-60s %s%s %5s\n", $sign, $name, $tip, $next, $count;
648
}
649
$ipbl = "\n";
650
}