[Buildbot-commits] buildbot/buildbot/changes freshcvs.py,1.21,1.22

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


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

Modified Files:
	freshcvs.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: freshcvs.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/changes/freshcvs.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- freshcvs.py	15 Nov 2005 08:38:05 -0000	1.21
+++ freshcvs.py	25 Nov 2005 00:36:41 -0000	1.22
@@ -65,13 +65,16 @@
         implements(IChangeSource)
     else:
         __implements__ = IChangeSource, TCPClient.__implements__
-    compare_attrs = ["where", "creds", "prefix"]
+    compare_attrs = ["host", "port", "username", "password", "prefix"]
 
     changemaster = None # filled in when we're added
     connected = False
 
     def __init__(self, host, port, user, passwd, prefix=None):
-        self.where = (host, port)
+        self.host = host
+        self.port = port
+        self.username = user
+        self.password = passwd
         if prefix is not None and not prefix.endswith("/"):
             log.msg("WARNING: prefix '%s' should probably end with a slash" \
                     % prefix)
@@ -85,15 +88,14 @@
         TCPClient.__init__(self, host, port, f)
 
     def __repr__(self):
-        return "<FreshCVSSource where=%s, prefix=%s>" % (self.where,
-                                                         self.prefix)
+        return "<FreshCVSSource where=%s, prefix=%s>" % \
+               ((self.host, self.port), self.prefix)
 
     def describe(self):
-        host, port = self.where
         online = ""
         if not self.connected:
             online = " [OFFLINE]"
-        return "freshcvs %s:%s%s" % (host, port, online)
+        return "freshcvs %s:%s%s" % (self.host, self.port, online)
 
     def notify(self, root, files, message, user):
         pathnames = []
@@ -126,7 +128,8 @@
 
     def __init__(self, host, port, user, passwd,
                  serviceName="cvstoys.notify", prefix=None):
-        self.where = (host, port)
+        self.host = host
+        self.port = port
         self.prefix = prefix
         self.listener = l = FreshCVSListener()
         l.source = self
@@ -136,23 +139,10 @@
         TCPClient.__init__(self, host, port, f)
 
     def __repr__(self):
-        return "<FreshCVSSourceOldcred where=%s, prefix=%s>" % (self.where,
-                                                                self.prefix)
+        return "<FreshCVSSourceOldcred where=%s, prefix=%s>" % \
+               ((self.host, self.port), self.prefix)
 
 # this is suitable for CVSToys-1.0.10 and later. If you run CVSToys-1.0.9 or
 # earlier, use FreshCVSSourceOldcred instead.
 FreshCVSSource = FreshCVSSourceNewcred
 
-def test(source):
-    # s = FreshCVSSource(blah)
-    # test(s)
-    from twisted.application import service
-    from twisted.internet import reactor
-    class Parent(service.MultiService):
-        def addChange(self, change):
-            print change.asText()
-    p = Parent()
-    source.setServiceParent(p)
-    p.startService()
-    reactor.run()
-





More information about the Commits mailing list