[Buildbot-commits] buildbot/buildbot/process step.py,1.75,1.76 builder.py,1.33,1.34

Brian Warner warner at users.sourceforge.net
Sat Nov 5 21:06:17 UTC 2005


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

Modified Files:
	step.py builder.py 
Log Message:
Revision: arch at buildbot.sf.net--2004/buildbot--dev--0--patch-408
Creator:  Brian Warner <warner at monolith.lothar.com>

add resubmit-build, change Step URLs

	* buildbot/interfaces.py (IBuilderControl.resubmitBuild): new
	method, takes an IBuildStatus and rebuilds it. It might make more
	sense to add this to IBuildControl instead, but that instance goes
	away completely once the build has finished, and resubmitting
	builds can take place weeks later.
	* buildbot/process/builder.py (BuilderControl.resubmitBuild): same
	* buildbot/status/html.py (StatusResourceBuild): also stash an
	IBuilderControl so we can use resubmitBuild.
	(StatusResourceBuild.body): render "resubmit" button if we can.
	Also add hrefs for each BuildStep
	(StatusResourceBuild.rebuild): add action for "resubmit" button
	(StatusResourceBuilder.getChild): give it an IBuilderControl

	* buildbot/status/builder.py (Status.getURLForThing): change the
	URL for BuildSteps to have a "step-" prefix, so the magic URLs
	that live as targets of buttons like "stop" and "rebuild" can't
	collide with them.
	* buildbot/status/builder.py (Status.getURLForThing): same
	* buildbot/status/html.py (StatusResourceBuild.getChild): same
	(StepBox.getBox): same
	* buildbot/test/test_web.py (GetURL): same
	(Logfile): same

	* buildbot/process/step.py (SVN.__init__): put svnurl/baseURL
	exclusivity checks after Source.__init__ upcall, so misspelled
	arguments will be reported more usefully
	(Darcs.__init__): same


Index: builder.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/builder.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- builder.py	20 Oct 2005 22:25:29 -0000	1.33
+++ builder.py	5 Nov 2005 21:06:15 -0000	1.34
@@ -649,6 +649,15 @@
             raise interfaces.NoSlaveError
         self.requestBuild(req)
 
+    def resubmitBuild(self, bs, reason="<rebuild, no reason given>"):
+        if not bs.isFinished():
+            return
+        branch, revision, patch = bs.getSourceStamp()
+        changes = bs.getChanges()
+        ss = sourcestamp.SourceStamp(branch, revision, patch, changes)
+        req = base.BuildRequest(reason, ss, self.original.name)
+        self.requestBuild(req)
+
     def getPendingBuilds(self):
         # return IBuildRequestControl objects
         raise NotImplementedError

Index: step.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/process/step.py,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- step.py	24 Oct 2005 22:42:03 -0000	1.75
+++ step.py	5 Nov 2005 21:06:15 -0000	1.76
@@ -1273,15 +1273,15 @@
                           DeprecationWarning)
             kwargs['workdir'] = directory
 
-        if not svnurl and not baseURL:
-            raise ValueError("you must use exactly one of svnurl and baseURL")
-
         self.svnurl = svnurl
         self.baseURL = baseURL
         self.branch = defaultBranch
 
         Source.__init__(self, **kwargs)
 
+        if not svnurl and not baseURL:
+            raise ValueError("you must use exactly one of svnurl and baseURL")
+
 
     def computeSourceRevision(self, changes):
         if not changes:
@@ -1385,15 +1385,15 @@
                               C{baseURL} and the result handed to the
                               'darcs pull' command.
         """
+        self.repourl = repourl
+        self.baseURL = baseURL
+        self.branch = defaultBranch
+        Source.__init__(self, **kwargs)
         assert kwargs['mode'] != "export", \
                "Darcs does not have an 'export' mode"
         if (not repourl and not baseURL) or (repourl and baseURL):
             raise ValueError("you must provide exactly one of repourl and"
                              " baseURL")
-        self.repourl = repourl
-        self.baseURL = baseURL
-        self.branch = defaultBranch
-        Source.__init__(self, **kwargs)
 
     def startVC(self, branch, revision, patch):
         slavever = self.slaveVersion("darcs")





More information about the Commits mailing list