OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import traceback | 6 import traceback |
7 import sys | 7 import sys |
8 | 8 |
9 from buildbot.process.properties import Properties | 9 from buildbot.process.properties import Properties |
10 from buildbot.schedulers.trysched import TryBase | 10 from buildbot.schedulers.trysched import TryBase |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 for email in options['email']: | 121 for email in options['email']: |
122 # Access to a protected member XXX of a client class | 122 # Access to a protected member XXX of a client class |
123 # pylint: disable=W0212 | 123 # pylint: disable=W0212 |
124 if not TryJobBase._EMAIL_VALIDATOR.match(email): | 124 if not TryJobBase._EMAIL_VALIDATOR.match(email): |
125 raise BadJobfile("'%s' is an invalid email address!" % email) | 125 raise BadJobfile("'%s' is an invalid email address!" % email) |
126 | 126 |
127 flatten(options, 'patch', None) | 127 flatten(options, 'patch', None) |
128 flatten(options, 'root', None) | 128 flatten(options, 'root', None) |
129 try_int(options, 'patchlevel', 0) | 129 try_int(options, 'patchlevel', 0) |
130 flatten(options, 'branch', None) | 130 flatten(options, 'branch', None) |
| 131 |
131 flatten(options, 'revision', None) | 132 flatten(options, 'revision', None) |
| 133 options.setdefault('orig_revision', options['revision']) |
| 134 |
132 flatten(options, 'reason', '%s: %s' % (options['user'], options['name'])) | 135 flatten(options, 'reason', '%s: %s' % (options['user'], options['name'])) |
133 try_bool(options, 'clobber', False) | 136 try_bool(options, 'clobber', False) |
134 | 137 |
135 flatten(options, 'project', pools.default_pool_name if pools else None) | 138 flatten(options, 'project', pools.default_pool_name if pools else None) |
136 flatten(options, 'repository', None) | 139 flatten(options, 'repository', None) |
137 | 140 |
138 # Code review info. Enforce numbers. | 141 # Code review info. Enforce numbers. |
139 try_int(options, 'patchset', None) | 142 try_int(options, 'patchset', None) |
140 try_int(options, 'issue', None) | 143 try_int(options, 'issue', None) |
141 | 144 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 def parse_options(self, options): | 202 def parse_options(self, options): |
200 return parse_options(options, self.valid_builders, self.pools) | 203 return parse_options(options, self.valid_builders, self.pools) |
201 | 204 |
202 def get_props(self, builder, options): | 205 def get_props(self, builder, options): |
203 """Current job extra properties that are not related to the source stamp. | 206 """Current job extra properties that are not related to the source stamp. |
204 Initialize with the Scheduler's base properties. | 207 Initialize with the Scheduler's base properties. |
205 """ | 208 """ |
206 keys = ( | 209 keys = ( |
207 'clobber', | 210 'clobber', |
208 'issue', | 211 'issue', |
| 212 'orig_revision', |
209 'patch_url', | 213 'patch_url', |
210 'patchset', | 214 'patchset', |
211 'requester', | 215 'requester', |
212 'rietveld', | 216 'rietveld', |
213 'root', | 217 'root', |
214 'try_job_key', | 218 'try_job_key', |
215 ) | 219 ) |
216 # All these settings have no meaning when False or not set, so don't set | 220 # All these settings have no meaning when False or not set, so don't set |
217 # them in that case. | 221 # them in that case. |
218 properties = dict((i, options[i]) for i in keys if options.get(i)) | 222 properties = dict((i, options[i]) for i in keys if options.get(i)) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 new_value > self._last_lkgr[project]): | 289 new_value > self._last_lkgr[project]): |
286 self._last_lkgr[project] = new_value | 290 self._last_lkgr[project] = new_value |
287 options['revision'] = self._last_lkgr[project] or 'HEAD' | 291 options['revision'] = self._last_lkgr[project] or 'HEAD' |
288 | 292 |
289 def Failure(result): | 293 def Failure(result): |
290 options['revision'] = self._last_lkgr[project] or 'HEAD' | 294 options['revision'] = self._last_lkgr[project] or 'HEAD' |
291 | 295 |
292 connection = client.getPage(last_good_url, agent='buildbot') | 296 connection = client.getPage(last_good_url, agent='buildbot') |
293 connection.addCallbacks(Success, Failure) | 297 connection.addCallbacks(Success, Failure) |
294 return connection | 298 return connection |
OLD | NEW |