From cd93b20f3dbf847de08d06bd2ddf0b071a4d54ba Mon Sep 17 00:00:00 2001 From: Chris AtLee Date: Fri, 22 May 2009 22:19:16 -0400 Subject: [PATCH] Clean up display of pending builds with changes --- buildbot/status/web/base.py | 4 ++++ buildbot/status/web/builder.py | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/buildbot/status/web/base.py b/buildbot/status/web/base.py index 98f9185..5b835b0 100644 --- a/buildbot/status/web/base.py +++ b/buildbot/status/web/base.py @@ -184,6 +184,10 @@ def path_to_slave(request, slave): "buildslaves/" + urllib.quote(slave.getName(), safe='')) +def path_to_change(request, change): + return (path_to_root(request) + + "changes/%s" % change.number) + class Box: # a Box wraps an Event. The Box has HTML parameters that Events # lack, and it has a base URL to which each File's name is relative. diff --git a/buildbot/status/web/builder.py b/buildbot/status/web/builder.py index 109fe6b..4afad1e 100644 --- a/buildbot/status/web/builder.py +++ b/buildbot/status/web/builder.py @@ -7,7 +7,8 @@ import re, urllib, time from twisted.python import log from buildbot import interfaces from buildbot.status.web.base import HtmlResource, make_row, \ - make_force_build_form, OneLineMixin, path_to_build, path_to_slave, path_to_builder + make_force_build_form, OneLineMixin, path_to_build, path_to_slave, \ + path_to_builder, path_to_change from buildbot.process.base import BuildRequest from buildbot.sourcestamp import SourceStamp @@ -54,8 +55,15 @@ class StatusResourceBuilder(HtmlResource, OneLineMixin): def request_line(self, build_request, req): when = time.strftime("%b %d %H:%M:%S", time.localtime(build_request.getSubmitTime())) delay = util.formatInterval(util.now() - build_request.getSubmitTime()) - if build_request.source.changes: - reason = "
\n".join(c.asHTML() for c in build_request.source.changes) + changes = build_request.source.changes + if changes: + change_strings = [] + for c in changes: + change_strings.append("%s" % (path_to_change(req, c), c.who)) + if len(change_strings) == 1: + reason = "change by %s" % change_strings[0] + else: + reason = "changes by %s" % ", ".join(change_strings) elif build_request.source.revision: reason = build_request.source.revision else: -- 2.11.4.GIT