[zorg] r180695 - If we are using a buildbot version that is at least as late as 0.8.7, we need to process our changes in the InformativeMailNotifier via build.getSourceStamps() instead of build.getSourceStamp().

Michael Gottesman mgottesman at apple.com
Sun Apr 28 22:44:45 PDT 2013


Author: mgottesman
Date: Mon Apr 29 00:44:45 2013
New Revision: 180695

URL: http://llvm.org/viewvc/llvm-project?rev=180695&view=rev
Log:
If we are using a buildbot version that is at least as late as 0.8.7, we need to process our changes in the InformativeMailNotifier via build.getSourceStamps() instead of build.getSourceStamp().

This should make InformativeMailNotifier work on llvmlab.

Modified:
    zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py

Modified: zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py?rev=180695&r1=180694&r2=180695&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py (original)
+++ zorg/trunk/zorg/buildbot/util/InformativeMailNotifier.py Mon Apr 29 00:44:45 2013
@@ -1,7 +1,34 @@
+import buildbot
 from buildbot import util, interfaces
 from zope.interface import implements
 from buildbot.status import builder, mail
 
+if buildbot.version[:5] >= '0.8.7':
+    def get_change_string(build):
+        data = ''
+        ss_list = build.getSourceStamps()
+        if ss_list:
+            data += 'CHANGES:\n'
+            for ss in ss_list:
+                data += '\n\n'.join([c.asText() for c in ss.changes])
+            data += '\n\n'
+        else:
+            data += 'NO SOURCE STAMP (CHANGES UNAVAILABLE)'
+            data += '\n\n'
+        return data
+else:
+    def get_change_string(build):
+        data = ''
+        ss = build.getSourceStamp()
+        if ss:
+            data += 'CHANGES:\n'
+            data += '\n\n'.join([c.asText() for c in ss.changes])
+            data += '\n\n'
+        else:
+            data += 'NO SOURCE STAMP (CHANGES UNAVAILABLE)'
+            data += '\n\n'
+        return data
+
 class InformativeMailNotifier(mail.MailNotifier):
     """MailNotifier subclass which provides additional information about the
     build failure inside the email."""
@@ -33,15 +60,8 @@ class InformativeMailNotifier(mail.MailN
         data += '\n' + '='*80 + '\n\n'
 
         # Append additional information on the changes.
-        ss = build.getSourceStamp()
-        if ss:
-            data += 'CHANGES:\n'
-            data += '\n\n'.join([c.asText() for c in ss.changes])
-            data += '\n\n'
-        else:
-            data += 'NO SOURCE STAMP (CHANGES UNAVAILABLE)'
-            data += '\n\n'
-    
+        data += get_change_string(build)
+
         # Append log files.
         if self.num_lines:
             data += 'LOGS:\n'





More information about the llvm-commits mailing list