| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-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 """Subclasses of various slave command classes.""" | 6 """Subclasses of various slave command classes.""" |
| 7 | 7 |
| 8 import copy | 8 import copy |
| 9 import os | 9 import os |
| 10 | 10 |
| 11 from buildbot.steps import source | 11 from buildbot.steps import source |
| 12 from buildbot.process import buildstep | 12 from buildbot.process import buildstep |
| 13 from buildbot import slave | 13 from buildbot import slave |
| 14 from buildbot.steps import shell | 14 from buildbot.steps import shell |
| 15 from buildbot.status import builder |
| 15 from log_parser import process_log | 16 from log_parser import process_log |
| 16 | 17 |
| 17 | 18 |
| 18 class GClient(source.Source): | 19 class GClient(source.Source): |
| 19 """Check out a source tree using gclient.""" | 20 """Check out a source tree using gclient.""" |
| 20 | 21 |
| 21 name = 'gclient' | 22 name = 'gclient' |
| 22 | 23 |
| 23 def __init__(self, svnurl=None, rm_timeout=None, gclient_spec=None, env=None, | 24 def __init__(self, svnurl=None, rm_timeout=None, gclient_spec=None, env=None, |
| 24 **kwargs): | 25 **kwargs): |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 119 |
| 119 def getText(self, cmd, results): | 120 def getText(self, cmd, results): |
| 120 text_list = self.describe(True) | 121 text_list = self.describe(True) |
| 121 if self._result_text: | 122 if self._result_text: |
| 122 self._result_text.insert(0, '<div class="BuildResultInfo">') | 123 self._result_text.insert(0, '<div class="BuildResultInfo">') |
| 123 self._result_text.append('</div>') | 124 self._result_text.append('</div>') |
| 124 text_list = text_list + self._result_text | 125 text_list = text_list + self._result_text |
| 125 return text_list | 126 return text_list |
| 126 | 127 |
| 127 def evaluateCommand(self, cmd): | 128 def evaluateCommand(self, cmd): |
| 128 # If the log processor provides a facility to evaluate its performance, | 129 result = None |
| 129 # call it. | |
| 130 if self._log_processor and self._log_processor.evaluateCommand: | |
| 131 return self._log_processor.evaluateCommand(cmd) | |
| 132 | 130 |
| 133 # Otherwise, report success by default. | 131 # If the log processor provides an evaluateCommand method, call it. |
| 134 return builder.SUCCESS | 132 if self._log_processor and 'evaluateCommand' in dir(self._log_processor): |
| 133 result = self._log_processor.evaluateCommand(cmd) |
| 134 |
| 135 if result is None or result is builder.SUCCESS: |
| 136 # Report success of parent command. |
| 137 result = shell.ShellCommand.evaluateCommand(self, cmd) |
| 138 |
| 139 return result |
| 135 | 140 |
| 136 def _CreateReportLinkIfNeccessary(self): | 141 def _CreateReportLinkIfNeccessary(self): |
| 137 if self._log_processor.ReportLink(): | 142 if self._log_processor.ReportLink(): |
| 138 self.addURL('results', "%s" % self._log_processor.ReportLink()) | 143 self.addURL('results', "%s" % self._log_processor.ReportLink()) |
| OLD | NEW |