[Buildbot-commits] buildbot/buildbot/process base.py,1.76,1.77

Brian Warner warner at users.sourceforge.net
Thu May 22 22:11:38 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot/process
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16534/buildbot/process

Modified Files:
	base.py 
Log Message:
[project @ #227:scheduler-property-in-build.patch]
Patch by Dossy Shiobara <dossy at panoptic.com>: It is useful to know
the name of the scheduler that initiated a build request, i.e., to
conditionally FileUpload the results of a Nightly scheduled build.
This patch passes the Scheduler along the BuildRequest chain so
that Build can setProperty("scheduler", self.scheduler.name) in
Build.setupStatus().

Original author: dustin at v.igoro.us
Date: 2008-04-04 02:54:25+00:00

Index: base.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/base.py,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- base.py	1 Dec 2007 01:48:58 -0000	1.76
+++ base.py	22 May 2008 22:11:36 -0000	1.77
@@ -52,12 +52,14 @@
 
     implements(interfaces.IBuildRequestControl)
 
-    def __init__(self, reason, source, builderName=None):
+    def __init__(self, reason, source, builderName=None, scheduler=None):
         # TODO: remove the =None on builderName, it is there so I don't have
         # to change a lot of tests that create BuildRequest objects
         assert interfaces.ISourceStamp(source, None)
         self.reason = reason
         self.source = source
+        self.scheduler = scheduler
+
         self.start_watchers = []
         self.finish_watchers = []
         self.status = BuildRequestStatus(source, builderName)
@@ -168,6 +170,7 @@
         # build a source stamp
         self.source = requests[0].mergeWith(requests[1:])
         self.reason = requests[0].mergeReasons(requests[1:])
+        self.scheduler = requests[0].scheduler
 
         #self.abandoned = False
 
@@ -261,6 +264,10 @@
         self.setProperty("buildnumber", self.build_status.number)
         self.setProperty("branch", self.source.branch)
         self.setProperty("revision", self.source.revision)
+        if self.scheduler is None:
+            self.setProperty("scheduler", "none")
+        else:
+            self.setProperty("scheduler", self.scheduler.name)
 
     def setupSlaveBuilder(self, slavebuilder):
         self.slavebuilder = slavebuilder





More information about the Commits mailing list