[pypy-svn] buildbot default: print the name of the branch

antocuni commits-noreply at bitbucket.org
Fri Jan 7 18:00:38 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r400:abbe42fde1b4
Date: 2011-01-07 17:44 +0100
http://bitbucket.org/pypy/buildbot/changeset/abbe42fde1b4/

Log:	print the name of the branch

diff --git a/bitbucket_hook/hook.py b/bitbucket_hook/hook.py
--- a/bitbucket_hook/hook.py
+++ b/bitbucket_hook/hook.py
@@ -86,7 +86,7 @@
                          key=operator.itemgetter('revision'))
         for commit in commits:
             message = commit['message'].replace('\n', ' ')
-            part1 = '%s %s: ' % (commit['author'], commit['node'])
+            part1 = '%s %s %s: ' % (commit['author'], commit['branch'], commit['node'])
             if len(message) + len(part1) <= 160:
                 irc_msg = part1 + message
             else:

diff --git a/bitbucket_hook/test/test_hook.py b/bitbucket_hook/test/test_hook.py
--- a/bitbucket_hook/test/test_hook.py
+++ b/bitbucket_hook/test/test_hook.py
@@ -56,12 +56,14 @@
     handler = MyHandler()
     handler.payload = {
         'commits': [{'revision': 42,
+                     'branch': u'default',
                      'author': u'antocuni',
                      'message': u'this is a test',
                      'node': 'abcdef'
                      },
                     {'revision': 43,
                      'author': u'antocuni',
+                     'branch': u'mybranch',
                      'message': LONG_MESSAGE,
                      'node': 'xxxyyy'
                      }
@@ -69,6 +71,6 @@
         }
     handler.handle_irc_message()
     msg1, msg2 = handler.messages
-    assert msg1 == 'antocuni abcdef: this is a test'
-    x = 'antocuni xxxyyy: %s...' % LONG_MESSAGE[:160-20]
+    assert msg1 == 'antocuni default abcdef: this is a test'
+    x = 'antocuni mybranch xxxyyy: %s...' % LONG_MESSAGE[:160-29]
     assert msg2 == x


More information about the Pypy-commit mailing list