Skip to content

Commit

Permalink
gotAllRevisions now returns an empty dict when the property is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit Allard committed May 10, 2012
1 parent ad8edd8 commit f22ed6a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion master/buildbot/status/build.py
Expand Up @@ -89,7 +89,7 @@ def getPreviousBuild(self):
return self.builder.getBuild(self.number-1)

def getAllGotRevisions(self):
all_got_revisions = self.properties.getProperty('got_revision', None)
all_got_revisions = self.properties.getProperty('got_revision', {})
# For backwards compatibility all_got_revisions is a string if codebases
# are not used. Convert to the default internal type (dict)
if isinstance(all_got_revisions, str):
Expand Down
5 changes: 1 addition & 4 deletions master/buildbot/status/web/base.py
Expand Up @@ -438,10 +438,7 @@ def get_line_values(self, req, build, include_builder=True):
if ss_list:
# TODO: support multiple sourcestamps in web interface
repo = ss_list[0].repository
if all_got_revision:
rev = all_got_revision[ss_list[0].codebase]
else:
rev = "??"
rev = all_got_revision.get(ss_list[0].codebase, "??")
else:
repo = 'unknown, no information in build'
rev = 'unknown'
Expand Down
5 changes: 2 additions & 3 deletions master/buildbot/status/web/build.py
Expand Up @@ -167,9 +167,8 @@ def content(self, req, cxt):
cxt['most_recent_rev_build'] = True

all_got_revisions = b.getAllGotRevisions()
if all_got_revisions:
got_revision = all_got_revisions.get(ss.codebase, "??")
cxt['got_revision'] = str(got_revision)
got_revision = all_got_revisions.get(ss.codebase, "??")
cxt['got_revision'] = str(got_revision)

try:
cxt['slave_url'] = path_to_slave(req, status.getSlave(b.getSlavename()))
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/status/web/builder.py
Expand Up @@ -515,7 +515,7 @@ def keep_count(statuses, builderName):
b = builds[0]
bld['build_url'] = (bld['link'] + "/builds/%d" % b.getNumber())
label = None
all_got_revisions = b.getAllGotRevisions() or {}
all_got_revisions = b.getAllGotRevisions()
# If len = 1 then try if revision can be used as label.
if len(all_got_revisions) == 1:
label = all_got_revisions[all_got_revisions.keys()[0]]
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/status/web/feeds.py
Expand Up @@ -179,7 +179,7 @@ def content(self, request):
# title: trunk r22191 (plus patch) failed on
# 'i686-debian-sarge1 shared gcc-3.3.5'
ss_list = build.getSourceStamps()
all_got_revisions = build.getAllGotRevisions() or {}
all_got_revisions = build.getAllGotRevisions()
src_cxts = []
for ss in ss_list:
sc = {}
Expand Down

0 comments on commit f22ed6a

Please sign in to comment.