[cig-commits] r6995 - in cs/buildbot/trunk/buildbot: . changes
status
leif at geodynamics.org
leif at geodynamics.org
Tue May 29 18:49:06 PDT 2007
Author: leif
Date: 2007-05-29 18:49:05 -0700 (Tue, 29 May 2007)
New Revision: 6995
Modified:
cs/buildbot/trunk/buildbot/changes/changes.py
cs/buildbot/trunk/buildbot/lines.py
cs/buildbot/trunk/buildbot/scheduler.py
cs/buildbot/trunk/buildbot/status/builder.py
cs/buildbot/trunk/buildbot/status/html.py
Log:
Filter the "changes" column using categories, so that (e.g.) the
CitcomS waterfall only displays CitcomS-related changes. Also: set
the 'title' on each change link, so that the revision comment is
displayed in a ballon/tooltip when the mouse hovers over the link.
Modified: cs/buildbot/trunk/buildbot/changes/changes.py
===================================================================
--- cs/buildbot/trunk/buildbot/changes/changes.py 2007-05-30 00:37:28 UTC (rev 6994)
+++ cs/buildbot/trunk/buildbot/changes/changes.py 2007-05-30 01:49:05 UTC (rev 6995)
@@ -63,6 +63,7 @@
root = None
branch = None
revision = None # used to create a source-stamp
+ category = None
def __init__(self, who, files, comments, isdir=0, links=[],
revision=None, when=None, root=None, branch=None):
@@ -217,10 +218,11 @@
def pruneChanges(self):
self.changes = self.changes[-100:] # or something
- def eventGenerator(self):
+ def eventGenerator(self, categories):
for i in range(len(self.changes)-1, -1, -1):
c = self.changes[i]
- yield c
+ if c.category in categories:
+ yield c
def getChangeNumbered(self, num):
if not self.changes:
Modified: cs/buildbot/trunk/buildbot/lines.py
===================================================================
--- cs/buildbot/trunk/buildbot/lines.py 2007-05-30 00:37:28 UTC (rev 6994)
+++ cs/buildbot/trunk/buildbot/lines.py 2007-05-30 01:49:05 UTC (rev 6995)
@@ -16,6 +16,10 @@
## cPickle.UnpickleableError: Cannot pickle <type 'weakproxy'> objects
# now pickling is disabled, but weakref also breaks Categories...
self.project = project #weakref.proxy(project)
+ # here's another cycle
+ self.category = Category(project = self.project,
+ branch = self.name,
+ type = 'test')
self.configs = {}
@@ -33,9 +37,7 @@
'name' : self.builderName(buildEnv, buildConfig),
'builddir' : env['BUILDDIR'],
'factory' : buildFactory,
- 'category' : Category(project = self.project,
- branch = self.name,
- type = 'test'),
+ 'category' : self.category,
}
return builder
@@ -99,6 +101,7 @@
self.scheduler = Scheduler(name = self.fullName(),
root = self.location.root(),
branch = self.location.branch(),
+ category = self.category,
builderNames = builderNames,
**kwds)
return self.scheduler
Modified: cs/buildbot/trunk/buildbot/scheduler.py
===================================================================
--- cs/buildbot/trunk/buildbot/scheduler.py 2007-05-30 00:37:28 UTC (rev 6994)
+++ cs/buildbot/trunk/buildbot/scheduler.py 2007-05-30 01:49:05 UTC (rev 6995)
@@ -79,7 +79,7 @@
compare_attrs = ('name', 'treeStableTimer', 'builderNames', 'root', 'branch',
'fileIsImportant')
- def __init__(self, name, root, branch, treeStableTimer, builderNames,
+ def __init__(self, name, root, branch, category, treeStableTimer, builderNames,
fileIsImportant=None):
"""
@param name: the name of this Scheduler
@@ -115,6 +115,7 @@
self.builderNames = builderNames
self.root = root
self.branch = branch
+ self.category = category
if fileIsImportant:
assert callable(fileIsImportant)
self.fileIsImportant = fileIsImportant
@@ -139,6 +140,7 @@
if change.branch != self.branch:
log.msg("%s ignoring off-branch %s" % (self, change))
return
+ change.category = self.category
if not self.fileIsImportant:
self.addImportantChange(change)
elif self.fileIsImportant(change):
@@ -201,7 +203,7 @@
compare_attrs = ('name', 'branches', 'treeStableTimer', 'builderNames',
'fileIsImportant')
- def __init__(self, name, branches, treeStableTimer, builderNames,
+ def __init__(self, name, branches, category, treeStableTimer, builderNames,
fileIsImportant=None):
"""
@param name: the name of this Scheduler
@@ -243,6 +245,7 @@
# prominent, but I can vaguely imagine situations where you might
# want to comment out branches temporarily and wouldn't
# appreciate it being treated as an error.
+ self.category = category
if fileIsImportant:
assert callable(fileIsImportant)
self.fileIsImportant = fileIsImportant
@@ -268,6 +271,7 @@
if self.branches is not None and path not in self.branches:
log.msg("%s ignoring off-branch %s" % (self, change))
return
+ change.category = self.category
s = self.schedulers.get(path)
if not s:
if branch:
Modified: cs/buildbot/trunk/buildbot/status/builder.py
===================================================================
--- cs/buildbot/trunk/buildbot/status/builder.py 2007-05-30 00:37:28 UTC (rev 6994)
+++ cs/buildbot/trunk/buildbot/status/builder.py 2007-05-30 01:49:05 UTC (rev 6995)
@@ -1502,7 +1502,7 @@
except IndexError:
return None
- def eventGenerator(self):
+ def eventGenerator(self, categories):
"""This function creates a generator which will provide all of this
Builder's status events, starting with the most recent and
progressing backwards in time. """
Modified: cs/buildbot/trunk/buildbot/status/html.py
===================================================================
--- cs/buildbot/trunk/buildbot/status/html.py 2007-05-30 00:37:28 UTC (rev 6994)
+++ cs/buildbot/trunk/buildbot/status/html.py 2007-05-30 01:49:05 UTC (rev 6995)
@@ -933,7 +933,7 @@
def getBox(self):
url = "changes/%d" % self.original.number
- text = '<a href="%s">%s</a>' % (url, html.escape(self.original.who))
+ text = '<a href="%s" title="%s">%s</a>' % (url, html.escape(self.original.comments), html.escape(self.original.who))
return Box([text], color="white", class_="Change")
components.registerAdapter(ChangeBox, changes.Change, IBox)
@@ -1138,7 +1138,7 @@
if phase == -1:
return self.body0(request, builders)
(changeNames, builderNames, timestamps, eventGrid, sourceEvents) = \
- self.buildGrid(request, builders)
+ self.buildGrid(request, builders, categories)
if phase == 0:
return self.phase0(request, (changeNames + builderNames),
timestamps, eventGrid)
@@ -1257,7 +1257,7 @@
data += "</table>\n"
return data
- def buildGrid(self, request, builders):
+ def buildGrid(self, request, builders, categories):
debug = False
# XXX: see if we can use a cached copy
@@ -1276,7 +1276,7 @@
sourceEvents = []
sourceGenerators = []
for s in sources:
- gen = insertGaps(s.eventGenerator(), lastEventTime)
+ gen = insertGaps(s.eventGenerator(categories), lastEventTime)
sourceGenerators.append(gen)
# get the first event
try:
More information about the cig-commits
mailing list