Skip to content

Commit

Permalink
Add missing codebase properties
Browse files Browse the repository at this point in the history
Also, sourcestamp['codebase'] is a string, not a dict.
  • Loading branch information
jpommerening authored and Xavier Delannoy committed Nov 5, 2014
1 parent 8af4cdf commit 3a1aa28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions master/buildbot/schedulers/timed.py
Expand Up @@ -270,7 +270,7 @@ def __init__(self, name, builderNames, minute=0, hour='*',
codebases=base.BaseScheduler.DEFAULT_CODEBASES):
if branch and branch is not Nightly.NoBranch:
if codebases is base.BaseScheduler.DEFAULT_CODEBASES:
codebases = {'': {'repository': '', 'branch': branch}}
codebases = {'': {'repository': '', 'project': '', 'branch': branch, 'revision': ''}}
else:
config.error("Nightly(%s): 'codebases' and 'branch' are mutually exclusive" % name)
NightlyBase.__init__(self, name=name, builderNames=builderNames,
Expand Down Expand Up @@ -384,7 +384,7 @@ def startBuild(self):
less_than=max_changeid + 1)
else:
# start a build of the latest revision, whatever that is
ss = {'codebase': self.getCodebaseDict('')}
ss = {'codebase': ''}
yield self.addBuildsetForSourceStampsWithDefaults(reason=self.reason,
sourcestamps=[ss])

Expand Down
5 changes: 3 additions & 2 deletions master/buildbot/test/unit/test_schedulers_timed_Nightly.py
Expand Up @@ -57,9 +57,10 @@ def addBuildsetForSourceStampsWithDefaults(reason, sourcestamps,
self.assertIn('scheduler named', reason)
isFirst = (self.events == [])

codebases = [ss['codebase'] for ss in sourcestamps] or [{}] # default codebase
codebases = [ss['codebase'] for ss in sourcestamps] or [''] # default codebase
codebase_dicts = map(sched.getCodebaseDict, codebases)

self.events.append('B(%s)@%d' % (''.join([str(cb.get('branch')) for cb in codebases]),
self.events.append('B(%s)@%d' % (''.join([str(cb.get('branch')) for cb in codebase_dicts]),
# show the offset as seconds past the GMT hour
self.clock.seconds() - self.localtime_offset))
if isFirst and firstBuildDuration:
Expand Down

0 comments on commit 3a1aa28

Please sign in to comment.