| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2008 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 | 7 |
| 8 from buildbot import buildset | 8 from buildbot import buildset |
| 9 from buildbot.scheduler import BadJobfile | 9 from buildbot.scheduler import BadJobfile |
| 10 from buildbot.scheduler import TryBase | 10 from buildbot.scheduler import TryBase |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 self.watcher.setServiceParent(self) | 29 self.watcher.setServiceParent(self) |
| 30 | 30 |
| 31 def parseJob(self, comment, diff): | 31 def parseJob(self, comment, diff): |
| 32 builderNames = [] | 32 builderNames = [] |
| 33 options = dict(item.split('=') for item in comment.splitlines()) | 33 options = dict(item.split('=') for item in comment.splitlines()) |
| 34 job_name = options.get('name', 'Unnamed') | 34 job_name = options.get('name', 'Unnamed') |
| 35 user = options.get('user', 'John Doe') | 35 user = options.get('user', 'John Doe') |
| 36 email = options.get('email', None) | 36 email = options.get('email', None) |
| 37 if 'user' in options and not email: | 37 if 'user' in options and not email: |
| 38 email = '%s@%s' % (user, config.Master.master_domain) | 38 email = '%s@%s' % (user, config.Master.master_domain) |
| 39 root = options.get('root', None) |
| 39 clobber = options.get('clobber', False) | 40 clobber = options.get('clobber', False) |
| 40 # -pN argument to patch. | 41 # -pN argument to patch. |
| 41 patchlevel = options.get('patchlevel', 0) | 42 patchlevel = options.get('patchlevel', 0) |
| 42 branch = options.get('branch', None) | 43 branch = options.get('branch', None) |
| 43 revision = options.get('revision', None) | 44 revision = options.get('revision', None) |
| 44 buildsetID = options.get('reason', "%s: %s" % (user, job_name)) | 45 buildsetID = options.get('reason', "%s: %s" % (user, job_name)) |
| 45 builderNames = [] | 46 builderNames = [] |
| 46 if 'bot' in options: | 47 if 'bot' in options: |
| 47 builderNames = [ options['bot'] ] | 48 builderNames = [ options['bot'] ] |
| 48 # TODO(maruel): Don't select the builders right now if not specified. | 49 # TODO(maruel): Don't select the builders right now if not specified. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 75 builderNames, job_stamp, buildsetID = self.parseJob(change.comments, | 76 builderNames, job_stamp, buildsetID = self.parseJob(change.comments, |
| 76 diff_content) | 77 diff_content) |
| 77 except BadJobfile: | 78 except BadJobfile: |
| 78 log.msg("%s reports a bad job connection" % (self)) | 79 log.msg("%s reports a bad job connection" % (self)) |
| 79 log.err() | 80 log.err() |
| 80 return | 81 return |
| 81 reason = "'%s' try job" % buildsetID | 82 reason = "'%s' try job" % buildsetID |
| 82 bs = buildset.BuildSet(builderNames, job_stamp, reason=reason, | 83 bs = buildset.BuildSet(builderNames, job_stamp, reason=reason, |
| 83 bsid=buildsetID) | 84 bsid=buildsetID) |
| 84 self.parent.submitBuildSet(bs) | 85 self.parent.submitBuildSet(bs) |
| OLD | NEW |