Skip to content

Commit

Permalink
Merge commit 'b9d93c391369d24f6bb36b3d17075c80dd45bb97' 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 56f7b89 + b9d93c3 commit 320f1e2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
20 changes: 13 additions & 7 deletions buildbot/status/web/builder.py
Expand Up @@ -68,7 +68,7 @@ def content(self, req, cxt):

if pb.source.changes:
for c in pb.source.changes:
change_strings.append({ 'url' : path_to_change(req, c),
changes.append({ 'url' : path_to_change(req, c),
'who' : c.who})
elif pb.source.revision:
reason = pb.source.revision
Expand All @@ -77,17 +77,17 @@ 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

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

cxt['cancel_url'] = path_to_builder(req, self.builder_status) + '/cancelbuild'

numbuilds = req.args.get('numbuilds', ['5'])[0]
recent = cxt['recent'] = []
Expand Down Expand Up @@ -187,15 +187,21 @@ def ping(self, req):

def cancel(self, req):
try:
request_id = int(req.args.get("id", [None])[0])
request_id = req.args.get("id", [None])[0]
if request_id == "all":
cancel_all = True
else:
cancel_all = False
request_id = int(request_id)
except:
request_id = None
if request_id:
for build_req in self.builder_control.getPendingBuilds():
if id(build_req.original_request.status) == request_id:
if cancel_all or id(build_req.original_request.status) == request_id:
log.msg("Cancelling %s" % build_req)
build_req.cancel()
break
if not cancel_all:
break
return Redirect(".")

def getChild(self, path, req):
Expand Down
8 changes: 7 additions & 1 deletion buildbot/status/web/templates/builder.html
Expand Up @@ -52,7 +52,13 @@ <h2>Pending builds:</h2>

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

<form method="pos" action="{{ cancel_url }}" class="command cancelbuild" style="display:inline">
<input type="hidden" name="id" value="all" />
<input type="submit" value="Cancel All" />
</form>

{% else %}
<h2>No pending builds</h2>
{% endif %}
Expand Down

0 comments on commit 320f1e2

Please sign in to comment.