diff --git a/buildbot/sourcestamp.py b/buildbot/sourcestamp.py index 78a9b2b77ce..7d0b0bb41db 100644 --- a/buildbot/sourcestamp.py +++ b/buildbot/sourcestamp.py @@ -141,18 +141,6 @@ def getText(self): text.append("[patch]") return text - def getHTMLDict(self): - if self.revision is None: - return dict(rev='latest') - d = dict(rev=self.revision) - if self.branch: - d['branch'] = self.branch - if self.patch: - d['patch'] = True - d['repository'] = self.repository - d['project'] = self.project - return d - def asDict(self): result = {} # Constant diff --git a/buildbot/status/web/grid.py b/buildbot/status/web/grid.py index 9a6c55683ce..de0b9bf0fa9 100644 --- a/buildbot/status/web/grid.py +++ b/buildbot/status/web/grid.py @@ -2,6 +2,7 @@ from buildbot.status.web.base import HtmlResource from buildbot.status.web.base import build_get_class, path_to_builder, path_to_build +from buildbot.sourcestamp import SourceStamp class ANYBRANCH: pass # a flag value, used below @@ -142,8 +143,8 @@ def content(self, request, cxt): cxt.update({'categories': categories, 'branch': branch, 'ANYBRANCH': ANYBRANCH, - 'stamps': stamps, - }) + 'stamps': map(SourceStamp.asDict, stamps) + }) sortedBuilderNames = status.getBuilderNames()[:] sortedBuilderNames.sort() @@ -201,7 +202,7 @@ def content(self, request, cxt): cxt.update({'categories': categories, 'branch': branch, 'ANYBRANCH': ANYBRANCH, - 'stamps': stamps, + 'stamps': map(SourceStamp.asDict, stamps), }) sortedBuilderNames = status.getBuilderNames()[:] diff --git a/buildbot/status/web/templates/grid.html b/buildbot/status/web/templates/grid.html index 0899f039677..f1fc20ba797 100644 --- a/buildbot/status/web/templates/grid.html +++ b/buildbot/status/web/templates/grid.html @@ -13,7 +13,7 @@

Grid View

{% for s in stamps %} - {{ grid.stamp_td(**s.getHTMLDict()) }} + {{ grid.stamp_td(s) }} {% endfor %} diff --git a/buildbot/status/web/templates/grid_macros.html b/buildbot/status/web/templates/grid_macros.html index 5590f1c9bad..81160fafd48 100644 --- a/buildbot/status/web/templates/grid_macros.html +++ b/buildbot/status/web/templates/grid_macros.html @@ -17,11 +17,13 @@ {%- endmacro %} -{% macro stamp_td(rev, branch=None, patch=False, project='', repository='') -%} +{% macro stamp_td(ss) -%} - {{- rev|shortrev(repository) }} - {%- if branch %} in {{ branch }}{% endif %} - {%- if patch %} [patch]{% endif %} + {%- if ss.revision -%} + {{ ss.revision|shortrev(ss.repository) }} + {%- else %}latest{% endif %} + {%- if ss.branch %} in {{ ss.branch|e }}{% endif %} + {%- if ss.hasPatch %} [patch]{% endif %} {%- endmacro %} diff --git a/buildbot/status/web/templates/grid_transposed.html b/buildbot/status/web/templates/grid_transposed.html index 6749cc157a0..4ee43bebe12 100644 --- a/buildbot/status/web/templates/grid_transposed.html +++ b/buildbot/status/web/templates/grid_transposed.html @@ -18,7 +18,7 @@

Transposed Grid View

{% for i in range %} - {{ grid.stamp_td(**stamps[i].getHTMLDict()) }} + {{ grid.stamp_td(stamps[i]) }} {% for b in builder_builds %} {{ grid.build_td(b[i]) }} {% endfor %}