Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import re | 5 import re |
| 6 | 6 |
| 7 import buildbot | 7 import buildbot |
| 8 from buildbot.process.properties import Properties | 8 from buildbot.process.properties import Properties |
| 9 | 9 |
| 10 from twisted.python import log | 10 from twisted.python import log |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 options.setdefault('project', self.pools.default_pool_name) | 65 options.setdefault('project', self.pools.default_pool_name) |
| 66 options.setdefault('repository', None) | 66 options.setdefault('repository', None) |
| 67 # Code review infos. Enforce numbers. | 67 # Code review infos. Enforce numbers. |
| 68 def try_int(key): | 68 def try_int(key): |
| 69 if options.setdefault(key, None) is None: | 69 if options.setdefault(key, None) is None: |
| 70 return | 70 return |
| 71 options[key] = int(options[key]) | 71 options[key] = int(options[key]) |
| 72 try_int('patchset') | 72 try_int('patchset') |
| 73 try_int('issue') | 73 try_int('issue') |
| 74 | 74 |
| 75 builder_names = [] | 75 build_names = [] |
| 76 if 'bot' in options: | 76 if 'bot' in options: |
| 77 builder_names = options.get('bot', '').split(',') | 77 build_names = options.get('bot', '').split(',') |
| 78 options['bot'] = self.pools.Select(builder_names, options['project']) | 78 options['bot'] = self.pools.Select(build_names, options['project']) |
| 79 bot_names = [b.split(':')[0] for b in options['bot']] | |
| 79 log.msg( | 80 log.msg( |
| 80 'Choose %s for job %s' % (','.join(options['bot']), options['reason'])) | 81 'Chose %s for job %s' % (','.join(bot_names), options['reason'])) |
|
Peter Mayo
2011/12/07 16:38:00
Only the tense change is necessary.
Peter Mayo
2011/12/09 21:29:08
Done.
| |
| 81 return options | 82 return options |
| 82 | 83 |
| 83 def get_props(self, options): | 84 def get_props(self, options): |
| 84 """Current job extra properties that are not related to the source stamp. | 85 """Current job extra properties that are not related to the source stamp. |
| 85 Initialize with the Scheduler's base properties. | 86 Initialize with the Scheduler's base properties. |
| 86 """ | 87 """ |
| 87 keys = ('clobber', 'issue', 'patchset', 'rietveld', 'testfilter') | 88 keys = ('clobber', 'issue', 'patchset', 'rietveld', 'testfilter', 'builds') |
|
Peter Mayo
2011/12/07 16:38:00
This can go away now.
Peter Mayo
2011/12/09 21:29:08
Done.
| |
| 88 # All these settings have no meaning when False or not set, so don't set | 89 # All these settings have no meaning when False or not set, so don't set |
| 89 # them in that case. | 90 # them in that case. |
| 90 properties = dict((i, options[i]) for i in keys if options.get(i)) | 91 properties = dict((i, options[i]) for i in keys if options.get(i)) |
| 91 props = Properties() | 92 props = Properties() |
| 92 props.updateFromProperties(self.properties) | 93 props.updateFromProperties(self.properties) |
| 93 props.update(properties, 'Try job') | 94 props.update(properties, 'Try job') |
| 94 return props | 95 return props |
| OLD | NEW |