[Buildbot-commits] buildbot/buildbot master.py,1.86,1.87

Brian Warner warner at users.sourceforge.net
Fri Nov 25 00:36:43 UTC 2005


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

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

fix loadConfig_Sources to remove all old ones before adding new ones

	* Makefile (TRIALARGS): update to handle Twisted > 2.1.0

	* buildbot/master.py (BuildMaster.loadConfig_Sources): remove all
	deleted ChangeSources before adding any new ones
	* buildbot/changes/freshcvs.py (FreshCVSSourceNewcred): fix
	compare_attrs, to make sure that a config-file reload does not
	unnecessarily replace an unmodified ChangeSource instance
	* buildbot/test/test_config.py (ConfigTest.testSources): update


Index: master.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/master.py,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- master.py	15 Nov 2005 08:56:58 -0000	1.86
+++ master.py	25 Nov 2005 00:36:41 -0000	1.87
@@ -885,12 +885,14 @@
         log.msg("loadConfig_Sources, change_svc is", self.change_svc,
                 self.change_svc.parent)
         # shut down any that were removed, start any that were added
-        oldsources = list(self.change_svc)
-        dl = [self.change_svc.removeSource(source)
-              for source in oldsources if source not in sources]
-        [self.change_svc.addSource(source)
-         for source in sources if source not in self.change_svc]
-        return defer.DeferredList(dl, fireOnOneErrback=1, consumeErrors=0)
+        deleted_sources = [s for s in self.change_svc if s not in sources]
+        added_sources = [s for s in sources if s not in self.change_svc]
+        dl = [self.change_svc.removeSource(s) for s in deleted_sources]
+        def addNewOnes(res):
+            [self.change_svc.addSource(s) for s in added_sources]
+        d = defer.DeferredList(dl, fireOnOneErrback=1, consumeErrors=0)
+        d.addCallback(addNewOnes)
+        return d
 
     def loadConfig_Schedulers(self, newschedulers):
         old = [s for s in self.schedulers if s not in newschedulers]





More information about the Commits mailing list