diff options
author | Neil Moore <neil@s-z.org> | 2012-10-11 10:43:51 -0500 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-10-11 10:43:51 -0500 |
commit | 1450fe313464fbad490485eb6396f65514975e26 (patch) | |
tree | 95552ebaa40ce58a5b94cfe86b8ed137d5d6d5b9 | |
parent | 51d349edfd98fac7561607935cea69667adbcb62 (diff) | |
download | crawlbot-1450fe313464fbad490485eb6396f65514975e26.tar.gz crawlbot-1450fe313464fbad490485eb6396f65514975e26.zip |
Limit commit announcements.
Announce at most ten commits per update (number is tunable).
-rw-r--r-- | lib/Crawl/Bot/Plugin/Commit.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Crawl/Bot/Plugin/Commit.pm b/lib/Crawl/Bot/Plugin/Commit.pm index 320dcb0..71d75ce 100644 --- a/lib/Crawl/Bot/Plugin/Commit.pm +++ b/lib/Crawl/Bot/Plugin/Commit.pm @@ -16,6 +16,12 @@ has announce_commits => ( default => 1, ); +has announce_limit => ( + is => 'rw', + isa => 'Int', + default => 10, +); + has colour_announce => ( is => 'rw', isa => 'Bool', @@ -160,7 +166,11 @@ sub tick { $self->say_all("Cherry-picked $cherry_picks commit$pl into $branch") if $cherry_picks > 0; + my $count = 0; for my $rev (@revs) { + if (++$count > $self->announce_limit) { + $self->say_all("... and " . (scalar @revs - $count + 1) . " more commits"); + } my $commit = $commits{$rev}; my $br = $branch eq "master" ? "" : "[$branch] "; |