summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2013-06-25 15:48:44 -0500
committerNeil Moore <neil@s-z.org>2013-06-25 16:36:01 -0500
commit93aceeef4ec5ef2007d0df55d666de047acc88a9 (patch)
tree7f0e6aa9510b2479d48a18ea1c03a7279e405cfe /lib
parente8e07e2500b51ba65faf4a207bd4965e11d96d4d (diff)
downloadcrawlbot-93aceeef4ec5ef2007d0df55d666de047acc88a9.tar.gz
crawlbot-93aceeef4ec5ef2007d0df55d666de047acc88a9.zip
Announce only playable branches in ##crawl.
Diffstat (limited to 'lib')
-rw-r--r--lib/Crawl/Bot/Plugin/Commit.pm19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/Crawl/Bot/Plugin/Commit.pm b/lib/Crawl/Bot/Plugin/Commit.pm
index 5fbe3f0..3f963ea 100644
--- a/lib/Crawl/Bot/Plugin/Commit.pm
+++ b/lib/Crawl/Bot/Plugin/Commit.pm
@@ -170,6 +170,18 @@ sub tick {
$self->say_all("New branch created: $branch ($nrev commit$pl)");
}
+ # Announce playable branches in ##crawl, all branches in ##crawl-dev.
+ my $say;
+ if ($branch =~ /^(?:master|stone_soup-.*)$/) {
+ $say = sub {
+ $self->say_all(@_)
+ }
+ } else {
+ $say = sub {
+ $self->say_main(@_)
+ }
+ }
+
if ($self->announce_commits) {
my %commits = map { $_, $self->parse_commit($_) } @revs;
@@ -178,7 +190,8 @@ sub tick {
&& $commits{$_}->{body} !~ /\(cherry picked from / } @revs;
$cherry_picks -= @revs;
my $pl = $cherry_picks == 1 ? "" : "s";
- $self->say_all("Cherry-picked $cherry_picks commit$pl into $branch")
+
+ $say->("Cherry-picked $cherry_picks commit$pl into $branch")
if $cherry_picks > 0;
my $count = 0;
@@ -186,7 +199,7 @@ sub tick {
# If it's just one more than the announce limit, don't bother with
# the message and announce the last commit anyway.
if (++$count > $self->announce_limit and scalar @revs > 1) {
- $self->say_all("... and " . (scalar @revs - $count + 1) . " more commits");
+ $say->("... and " . (scalar @revs - $count + 1) . " more commits");
last;
}
my $commit = $commits{$rev};
@@ -197,7 +210,7 @@ sub tick {
my $revname = $commit->{revname} || "r$abbr";
- $self->say_all(
+ $say->(
sprintf(
"%s%s%s %s%s%s* %s%s%s:%s %s%s%s %s(%s, %s file%s, %s+ %s-)%s %s%s%s",
$self->colour(announce => "author"), $commit->{author},