From 643303860ce80fcbeecb06bc87d5c0ea5c96e4a4 Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Tue, 2 Jun 2015 21:26:59 +0300 Subject: Show branch name for travis builds --- local/handler/TravisHandler.py | 1 + local/theme/DefaultTheme.py | 5 +++-- test.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/local/handler/TravisHandler.py b/local/handler/TravisHandler.py index bdfb484..3648422 100644 --- a/local/handler/TravisHandler.py +++ b/local/handler/TravisHandler.py @@ -3,6 +3,7 @@ from ..utility import * def handle(data, theme): if isStatusVisible(data['repository']['url'], data['status_message'].lower()): theme.travis( + branch = data['branch'], repo = data['repository']['name'], status = data['status_message'], commitId = data['commit'], diff --git a/local/theme/DefaultTheme.py b/local/theme/DefaultTheme.py index 1645cf4..48badb8 100644 --- a/local/theme/DefaultTheme.py +++ b/local/theme/DefaultTheme.py @@ -135,8 +135,9 @@ class DefaultTheme(Theme): pageurl, )) - def travis(self, repo, status, commitId, commitMessage, commitAuthor, buildUrl): - self.msgs.append( "%s: Build status: %s * %s by %s (%s - %s)" % ( + def travis(self, branch, repo, status, commitId, commitMessage, commitAuthor, buildUrl): + self.msgs.append( "%s @ %s: Build status: %s * %s by %s (%s - %s)" % ( + ircutils.bold(ircutils.mircColor(branch, "blue")), ircutils.bold(repo), colorAction(status.lower()), ircutils.bold(commitId[0:6]), diff --git a/test.py b/test.py index d015c3b..be5d8cb 100644 --- a/test.py +++ b/test.py @@ -73,7 +73,7 @@ class GithubTestCase(ExpectationPluginTestCase): self.sendRequest('travis-notification') self.describe('first message', - it().should.contain('minimal'), + it().should.contain('master @ minimal'), it().should.contain('passed'), it().should.contain('62aae'), it().should.contain('Sven Fuchs'), -- cgit v1.2.3