Chromium Code Reviews| 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 """Subclasses of various slave command classes.""" | 5 """Subclasses of various slave command classes.""" |
| 6 | 6 |
| 7 import copy | 7 import copy |
| 8 import errno | 8 import errno |
| 9 import json | 9 import json |
| 10 import logging | 10 import logging |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 if not changes: | 94 if not changes: |
| 95 return None | 95 return None |
| 96 # Change revision numbers can be invalid, for a try job for instance. | 96 # Change revision numbers can be invalid, for a try job for instance. |
| 97 # TODO(maruel): Make this work for git hash. | 97 # TODO(maruel): Make this work for git hash. |
| 98 lastChange = max([change_to_revision(c) for c in changes]) | 98 lastChange = max([change_to_revision(c) for c in changes]) |
| 99 return lastChange | 99 return lastChange |
| 100 | 100 |
| 101 def startVC(self, branch, revision, patch): | 101 def startVC(self, branch, revision, patch): |
| 102 warnings = [] | 102 warnings = [] |
| 103 args = copy.copy(self.args) | 103 args = copy.copy(self.args) |
| 104 wk_revision = revision | 104 wk_revision = None |
| 105 try: | 105 try: |
| 106 # parent_wk_revision might be set, but empty. | 106 # parent_wk_revision might be set, but empty. |
| 107 if self.getProperty('parent_wk_revision'): | 107 if self.getProperty('parent_wk_revision'): |
| 108 wk_revision = self.getProperty('parent_wk_revision') | 108 wk_revision = self.getProperty('parent_wk_revision') |
| 109 except KeyError: | 109 except KeyError: |
| 110 pass | 110 pass |
| 111 if patch and patch[1].startswith('third_party/WebKit@HEAD'): | |
| 112 wk_revision = 'HEAD' | |
|
Dirk Pranke
2013/02/07 03:42:33
are you sure "HEAD" works here? don't the try serv
M-A Ruel
2013/02/07 14:01:53
I kind of agree I'd prefer a regexp to allow numbe
tony
2013/02/07 22:13:49
HEAD does work, but I've switched it to a regex to
| |
| 113 | |
| 111 nacl_revision = revision | 114 nacl_revision = revision |
| 112 try: | 115 try: |
| 113 # parent_nacl_revision might be set, but empty. | 116 # parent_nacl_revision might be set, but empty. |
| 114 if self.getProperty('parent_got_nacl_revision'): | 117 if self.getProperty('parent_got_nacl_revision'): |
| 115 nacl_revision = self.getProperty('parent_got_nacl_revision') | 118 nacl_revision = self.getProperty('parent_got_nacl_revision') |
| 116 except KeyError: | 119 except KeyError: |
| 117 pass | 120 pass |
| 118 try: | 121 try: |
| 119 # parent_cr_revision might be set, but empty. | 122 # parent_cr_revision might be set, but empty. |
| 120 if self.getProperty('parent_cr_revision'): | 123 if self.getProperty('parent_cr_revision'): |
| 121 revision = 'src@' + self.getProperty('parent_cr_revision') | 124 revision = 'src@' + self.getProperty('parent_cr_revision') |
| 122 except KeyError: | 125 except KeyError: |
| 123 pass | 126 pass |
| 124 self.setProperty('primary_repo', args['primary_repo'], 'Source') | 127 self.setProperty('primary_repo', args['primary_repo'], 'Source') |
| 125 args['revision'] = revision | 128 args['revision'] = revision |
| 126 args['branch'] = branch | 129 args['branch'] = branch |
| 127 if args.get('gclient_spec'): | 130 if args.get('gclient_spec'): |
| 128 args['gclient_spec'] = args['gclient_spec'].replace( | 131 if wk_revision: |
| 129 '$$WK_REV$$', str(wk_revision or '')) | 132 args['gclient_spec'] = args['gclient_spec'].replace( |
| 133 '$$WK_REV$$', str(wk_revision)) | |
| 134 else: | |
| 135 args['gclient_spec'] = args['gclient_spec'].replace( | |
| 136 ',"webkit_revision":"$$WK_REV$$"', '') | |
| 130 args['gclient_spec'] = args['gclient_spec'].replace( | 137 args['gclient_spec'] = args['gclient_spec'].replace( |
| 131 '$$NACL_REV$$', str(nacl_revision or '')) | 138 '$$NACL_REV$$', str(nacl_revision or '')) |
| 132 if patch: | 139 if patch: |
| 133 args['patch'] = patch | 140 args['patch'] = patch |
| 134 elif args.get('patch') is None: | 141 elif args.get('patch') is None: |
| 135 del args['patch'] | 142 del args['patch'] |
| 136 cmd = buildstep.LoggedRemoteCommand('gclient', args) | 143 cmd = buildstep.LoggedRemoteCommand('gclient', args) |
| 137 self.startCommand(cmd, warnings) | 144 self.startCommand(cmd, warnings) |
| 138 | 145 |
| 139 def describe(self, done=False): | 146 def describe(self, done=False): |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1065 def evaluateCommand(self, cmd): | 1072 def evaluateCommand(self, cmd): |
| 1066 observer_result = self.script_observer.annotate_status | 1073 observer_result = self.script_observer.annotate_status |
| 1067 # Check if ProcessLogShellStep detected a failure or warning also. | 1074 # Check if ProcessLogShellStep detected a failure or warning also. |
| 1068 log_processor_result = ProcessLogShellStep.evaluateCommand(self, cmd) | 1075 log_processor_result = ProcessLogShellStep.evaluateCommand(self, cmd) |
| 1069 return BuilderStatus.combine(observer_result, log_processor_result) | 1076 return BuilderStatus.combine(observer_result, log_processor_result) |
| 1070 | 1077 |
| 1071 def commandComplete(self, cmd): | 1078 def commandComplete(self, cmd): |
| 1072 self.script_observer.handleReturnCode(cmd.rc) | 1079 self.script_observer.handleReturnCode(cmd.rc) |
| 1073 self._removePreamble() | 1080 self._removePreamble() |
| 1074 return ProcessLogShellStep.commandComplete(self, cmd) | 1081 return ProcessLogShellStep.commandComplete(self, cmd) |
| OLD | NEW |