#
# Update an older edition of What's Cooking with the latest data.
#
-# Usage: UWC [ old [ new ] ]
+# Usage: UWC [--keep-master] [ old [ new ] ]
#
# Giving no parameter is the same as giving a single "-" to the command.
#
# previously sent in a buffer in Emacs, and filter the buffer contents
# with this script, to prepare an up-to-date message.
+my $keep_master = 1;
+
sub parse_whats_cooking {
my ($fh) = @_;
my $head = undef;
}
}
- if (%{$new_wc->{"topic hash"}}) {
- if (@gone) {
- $group = 'Graduated to "master"';
- if (!exists $old_wc->{" $group"}) {
- unshift @{$old_wc->{"group list"}}, $group;
- $old_wc->{" $group"} = [];
- }
- push @{$old_wc->{" $group"}}, @gone;
+
+ $group = 'Graduated to "master"';
+ if (!$keep_master) {
+ print STDERR "Not Keeping Master\n";
+ my $o = delete $old_wc->{" $group"};
+ for (@$o) {
+ print STDERR " Dropping: ", $_->{'topic'}, "\n";
+ }
+ print STDERR "Gone are\n";
+ for (@gone) {
+ print STDERR " Gone: ", $_->{'topic'}, "\n";
+ }
+ }
+ if (@gone) {
+ if (!exists $old_wc->{" $group"}) {
+ unshift @{$old_wc->{"group list"}}, $group;
+ $old_wc->{" $group"} = [];
}
+ push @{$old_wc->{" $group"}}, @gone;
+ }
+ if (%{$new_wc->{"topic hash"}}) {
$group = "New Topics";
if (!exists $old_wc->{" $group"}) {
unshift @{$old_wc->{"group list"}}, $group;
if (@ARGV == 0) {
@ARGV = ('-');
+} elsif ($ARGV[0] eq '--keep-master') {
+ $keep_master = 1;
+ shift;
}
if (@ARGV != 2 && @ARGV != 1) {
die "Usage: $0 old [new]\n";
master_at=$(git rev-parse --verify refs/heads/master)
next_at=$(git rev-parse --verify refs/heads/next)
+keep_master=
case "$1" in
generate)
echo Here are the topics that have been
Meta/git-topic.perl --base=master | sed -e 's/^\*./\n*/'
exit
;;
+keep)
+ keep_master=--keep-master
+ ;;
esac
eval $(LC_ALL=C date +"monthname=%b month=%m year=%Y date=%d dow=%a")
)
sed -e 's/^\[New Topics\]$/[Old New Topics]/' "Meta/$last" |
-Meta/UWC
+Meta/UWC $keep_master