Skip to content

Commit

Permalink
Merge commit 'cd93b20f3dbf847de08d06bd2ddf0b071a4d54ba' into jinja
Browse files Browse the repository at this point in the history
Conflicts:
	buildbot/status/web/builder.py
  • Loading branch information
marcus-sonestedt committed Dec 13, 2009
2 parents 2a5233f + cd93b20 commit fff85dc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
4 changes: 4 additions & 0 deletions buildbot/status/web/base.py
Expand Up @@ -118,6 +118,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 <td> parameters that Events
# lack, and it has a base URL to which each File's name is relative.
Expand Down
18 changes: 12 additions & 6 deletions buildbot/status/web/builder.py
Expand Up @@ -6,7 +6,8 @@
import re, urllib, time
from twisted.python import log
from buildbot import interfaces
from buildbot.status.web.base import HtmlResource, BuildLineMixin, path_to_build, path_to_slave, path_to_builder
from buildbot.status.web.base import HtmlResource, BuildLineMixin, \
path_to_build, path_to_slave, path_to_builder, path_to_change
from buildbot.process.base import BuildRequest
from buildbot.sourcestamp import SourceStamp

Expand Down Expand Up @@ -47,8 +48,7 @@ def builder(self, build, req):
b['stop_url'] = path_to_build(req, build) + '/stop'

return b



def content(self, req, cxt):
b = self.builder_status
control = self.builder_control
Expand All @@ -63,8 +63,12 @@ def content(self, req, cxt):

cxt['pending'] = []
for pb in b.getPendingBuilds():
changes = []

if pb.source.changes:
reason = "<br/>\n".join(c.asHTML() for c in pb.source.changes)
for c in pb.source.changes:
change_strings.append({ 'url' : path_to_change(req, c),
'who' : c.who})
elif pb.source.revision:
reason = pb.source.revision
else:
Expand All @@ -73,13 +77,15 @@ def content(self, req, cxt):
if self.builder_control is not None:
cancel_url = path_to_builder(req, self.builder.status) + '/cancelbuild'
else:
cancel_url = None
cancel_url = None

cxt['pending'].append({
'when': time.strftime("%b %d %H:%M:%S", time.localtime(pb.getSubmitTime())),
'delay': util.formatInterval(util.now() - build_request.getSubmitTime()),
'reason': reason,
'cancel_url': cancel_url,
'id': id(pb)
'id': id(pb),
'changes' : changes
})

numbuilds = req.args.get('numbuilds', ['5'])[0]
Expand Down
10 changes: 9 additions & 1 deletion buildbot/status/web/templates/builder.html
Expand Up @@ -35,13 +35,21 @@ <h2>No current builds</h2>
<h2>Pending builds:</h2>
<ul>
{% for b in pending %}
<li><font size="-1">({{ b.when }})</font> {{ b.reason }}
<li><font size="-1">({{ b.when }}, waiting {{ b.delay }})</font>

{% if b.cancel_url %}
<form method="post" action="{{ b.cancel_url }}" class="command cancelbuild" style="display:inline">
<input type="hidden" name="id" value="{{ b.id }}" />
<input type="submit" value="Cancel Build" />
</form>
{% endif %}

{% if b.changes %}
{% for c in b.changes %}<a href="{{ c.url }}">{{ c.who }}</a>{% endfor %}
{% else %}
{{ b.reason }}
{% endif %}

</li>
{% endfor %}
</ul>
Expand Down

0 comments on commit fff85dc

Please sign in to comment.