Skip to content

Commit

Permalink
Improve presentation of multiple changes in pending builds
Browse files Browse the repository at this point in the history
Previously displayed change.who as a link to the change, with no joining
whitespace; now displays revision with a change link for up to 3
changes, otherwise a count of changes.  Fixes #1700
  • Loading branch information
djmitche committed Dec 4, 2010
1 parent 89d01b5 commit 4d26d6d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
7 changes: 5 additions & 2 deletions master/buildbot/status/web/base.py
Expand Up @@ -534,13 +534,16 @@ def shortrevfilter(replace, templates):

url_f = _revlinkcfg(replace, templates)

def filter(rev, repo):
def filter(rev, repo=None):
if not rev:
return u''

id_html, short_html = _revlinkmacros(replace, templates)
rev = unicode(rev)
url = url_f(rev, repo)
if repo:
url = url_f(rev, repo)
else:
url = None
rev = jinja2.escape(rev)
shortrev = rev[:12] # TODO: customize this depending on vc type

Expand Down
11 changes: 4 additions & 7 deletions master/buildbot/status/web/builder.py
Expand Up @@ -69,18 +69,15 @@ def content(self, req, cxt):
if source.changes:
for c in source.changes:
changes.append({ 'url' : path_to_change(req, c),
'who' : c.who})
if source.revision:
reason = source.revision
else:
reason = "no changes specified"
'who' : c.who,
'revision' : c.revision })

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

numbuilds = int(req.args.get('numbuilds', ['5'])[0])
Expand Down
7 changes: 4 additions & 3 deletions master/buildbot/status/web/templates/builder.html
Expand Up @@ -41,10 +41,11 @@ <h2>Pending builds:</h2>
{{ forms.cancel_pending_build(builder_url+"/cancelbuild", authz, short=True, id=b.id) }}
{% endif %}

{% if b.changes %}
{% for c in b.changes %}<a href="{{ c.url }}">{{ c.who|email }}</a>{% endfor %}
{% if b.num_changes < 4 %}
{% for c in b.changes %}<a href="{{ c.url }}">{{ c.revision|shortrev }}
by {{ c.who }}</a> {% endfor %}
{% else %}
{{ b.reason }}
({{ b.num_changes }} changes)
{% endif %}

</li>
Expand Down

0 comments on commit 4d26d6d

Please sign in to comment.