1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 from zope.interface import implements
39 from twisted.python import log
40 from twisted.internet import defer
41 from twisted.application import service
42
43 from buildbot import interfaces, util
44
46
47 """This is the master-side service which receives file change
48 notifications from a VCS. It keeps a log of these changes, enough to
49 provide for the HTML waterfall display, and to tell
50 temporarily-disconnected bots what they missed while they were
51 offline.
52
53 Change notifications come from two different kinds of sources. The first
54 is a PB service (servicename='changemaster', perspectivename='change'),
55 which provides a remote method called 'addChange', which should be
56 called with a dict that has keys 'filename' and 'comments'.
57
58 The second is a list of objects derived from the
59 L{buildbot.changes.base.ChangeSource} class. These are added with
60 .addSource(), which also sets the .changemaster attribute in the source
61 to point at the ChangeMaster. When the application begins, these will
62 be started with .start() . At shutdown time, they will be terminated
63 with .stop() . They must be persistable. They are expected to call
64 self.changemaster.addChange() with Change objects.
65
66 There are several different variants of the second type of source:
67
68 - L{buildbot.changes.mail.MaildirSource} watches a maildir for CVS
69 commit mail. It uses DNotify if available, or polls every 10
70 seconds if not. It parses incoming mail to determine what files
71 were changed.
72
73 - L{buildbot.changes.freshcvs.FreshCVSSource} makes a PB
74 connection to the CVSToys 'freshcvs' daemon and relays any
75 changes it announces.
76
77 """
78
79 implements(interfaces.IEventSource)
80
81 changeHorizon = 0
82 name = "changemanager"
83
87
92
96
98 """Deliver a file change event. The event should be a Change object.
99 This method will timestamp the object as it is received."""
100 log.msg("adding change, who %s, %d files, rev=%s, branch=%s, repository=%s, "
101 "comments %s, category %s" % (change.who, len(change.files),
102 change.revision, change.branch, change.repository,
103 change.comments, change.category))
104
105
106
107
108
109
110
111
112
113 self.parent.addChange(change)
114
115
116
117
118 - def eventGenerator(self, branches=[], categories=[], committers=[], minTime=0):
121
132