diff options
author | Neil Moore <neil@s-z.org> | 2012-05-04 21:26:10 -0500 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-05-04 21:26:10 -0500 |
commit | 55cbda7b5dd9d0de728726646ea08f06055f47b0 (patch) | |
tree | 892aa6d96d35d1809b0c99e5266ae5926eff1601 | |
parent | a2f81095acaa7f73ee79d1fdddef3dd47518c9c2 (diff) | |
download | crawlbot-55cbda7b5dd9d0de728726646ea08f06055f47b0.tar.gz crawlbot-55cbda7b5dd9d0de728726646ea08f06055f47b0.zip |
Re-enable commit announcements.
And change the format slightly.
-rw-r--r-- | lib/Crawl/Bot/Plugin/Commit.pm | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/lib/Crawl/Bot/Plugin/Commit.pm b/lib/Crawl/Bot/Plugin/Commit.pm index 70b7278..1172413 100644 --- a/lib/Crawl/Bot/Plugin/Commit.pm +++ b/lib/Crawl/Bot/Plugin/Commit.pm @@ -10,6 +10,12 @@ has repo_uri => ( default => 'git://gitorious.org/crawl/crawl.git', ); +has announce_commits => ( + is => 'rw', + isa => 'Bool', + default => 1, +); + has checkout => ( is => 'ro', isa => 'Str', @@ -83,21 +89,23 @@ sub tick { $self->say_all("New branch created: $branch ($nrev commits)"); } -# my %commits = map { $_, $self->parse_commit($_) } @revs; -# -# my $cherry_picks = @revs; -# @revs = grep { $commits{$_}->{subject} !~ /\(cherry picked from / -# && $commits{$_}->{body} !~ /\(cherry picked from / } @revs; -# $cherry_picks -= @revs; -# $self->say_all("Cherry-picked $cherry_picks commits into $branch") -# if $cherry_picks > 0; -# -# for my $rev (@revs) { -# my $commit = $commits{$rev}; -# my $abbr = substr($rev, 0, 12); -# my $br = $branch eq "master" ? "" : "$branch "; -# $self->say_all("$commit->{author} $br* r$abbr ($commit->{nfiles} changed): $commit->{subject}"); -# } + if ($self->announce_commits) { + my %commits = map { $_, $self->parse_commit($_) } @revs; + + my $cherry_picks = @revs; + @revs = grep { $commits{$_}->{subject} !~ /\(cherry picked from / + && $commits{$_}->{body} !~ /\(cherry picked from / } @revs; + $cherry_picks -= @revs; + $self->say_all("Cherry-picked $cherry_picks commits into $branch") + if $cherry_picks > 0; + + for my $rev (@revs) { + my $commit = $commits{$rev}; + my $abbr = substr($rev, 0, 12); + my $br = $branch eq "master" ? "" : "[$branch] "; + $self->say_all("$commit->{author} $br* $abbr ($commit->{nfiles} changed): $commit->{subject}"); + } + } $self->head($branch => $head); } |