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 |
|
M-A Ruel
2013/02/08 19:36:40
Why are you ditching revision? Won't this break ca
tony
2013/02/08 19:50:33
No, this value was never used. The code in the tr
| |
| 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: | |
| 112 match = re.search(r'third_party/WebKit@(\w+)', patch[1]) | |
| 113 if match: | |
| 114 wk_revision = match.group(1) | |
| 115 | |
| 111 nacl_revision = revision | 116 nacl_revision = revision |
|
M-A Ruel
2013/02/08 19:36:40
In particular, this doesn't get changed.
tony
2013/02/08 19:50:33
I suspect this is only used by some builder/tester
| |
| 112 try: | 117 try: |
| 113 # parent_nacl_revision might be set, but empty. | 118 # parent_nacl_revision might be set, but empty. |
| 114 if self.getProperty('parent_got_nacl_revision'): | 119 if self.getProperty('parent_got_nacl_revision'): |
| 115 nacl_revision = self.getProperty('parent_got_nacl_revision') | 120 nacl_revision = self.getProperty('parent_got_nacl_revision') |
| 116 except KeyError: | 121 except KeyError: |
| 117 pass | 122 pass |
| 118 try: | 123 try: |
| 119 # parent_cr_revision might be set, but empty. | 124 # parent_cr_revision might be set, but empty. |
| 120 if self.getProperty('parent_cr_revision'): | 125 if self.getProperty('parent_cr_revision'): |
| 121 revision = 'src@' + self.getProperty('parent_cr_revision') | 126 revision = 'src@' + self.getProperty('parent_cr_revision') |
| 122 except KeyError: | 127 except KeyError: |
| 123 pass | 128 pass |
| 124 self.setProperty('primary_repo', args['primary_repo'], 'Source') | 129 self.setProperty('primary_repo', args['primary_repo'], 'Source') |
| 125 args['revision'] = revision | 130 args['revision'] = revision |
| 126 args['branch'] = branch | 131 args['branch'] = branch |
| 127 if args.get('gclient_spec'): | 132 if args.get('gclient_spec'): |
| 128 args['gclient_spec'] = args['gclient_spec'].replace( | 133 if wk_revision: |
| 129 '$$WK_REV$$', str(wk_revision or '')) | 134 args['gclient_spec'] = args['gclient_spec'].replace( |
| 135 '$$WK_REV$$', str(wk_revision)) | |
| 136 else: | |
| 137 args['gclient_spec'] = args['gclient_spec'].replace( | |
| 138 ',"webkit_revision":"$$WK_REV$$"', '') | |
|
M-A Ruel
2013/02/08 19:36:40
I'd remove the initial comma, since this assumes a
tony
2013/02/08 19:50:33
If we don't remove the comma, the python dictionar
M-A Ruel
2013/02/11 18:26:57
Don't bother
| |
| 130 args['gclient_spec'] = args['gclient_spec'].replace( | 139 args['gclient_spec'] = args['gclient_spec'].replace( |
| 131 '$$NACL_REV$$', str(nacl_revision or '')) | 140 '$$NACL_REV$$', str(nacl_revision or '')) |
| 132 if patch: | 141 if patch: |
| 133 args['patch'] = patch | 142 args['patch'] = patch |
| 134 elif args.get('patch') is None: | 143 elif args.get('patch') is None: |
| 135 del args['patch'] | 144 del args['patch'] |
| 136 cmd = buildstep.LoggedRemoteCommand('gclient', args) | 145 cmd = buildstep.LoggedRemoteCommand('gclient', args) |
| 137 self.startCommand(cmd, warnings) | 146 self.startCommand(cmd, warnings) |
| 138 | 147 |
| 139 def describe(self, done=False): | 148 def describe(self, done=False): |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1065 def evaluateCommand(self, cmd): | 1074 def evaluateCommand(self, cmd): |
| 1066 observer_result = self.script_observer.annotate_status | 1075 observer_result = self.script_observer.annotate_status |
| 1067 # Check if ProcessLogShellStep detected a failure or warning also. | 1076 # Check if ProcessLogShellStep detected a failure or warning also. |
| 1068 log_processor_result = ProcessLogShellStep.evaluateCommand(self, cmd) | 1077 log_processor_result = ProcessLogShellStep.evaluateCommand(self, cmd) |
| 1069 return BuilderStatus.combine(observer_result, log_processor_result) | 1078 return BuilderStatus.combine(observer_result, log_processor_result) |
| 1070 | 1079 |
| 1071 def commandComplete(self, cmd): | 1080 def commandComplete(self, cmd): |
| 1072 self.script_observer.handleReturnCode(cmd.rc) | 1081 self.script_observer.handleReturnCode(cmd.rc) |
| 1073 self._removePreamble() | 1082 self._removePreamble() |
| 1074 return ProcessLogShellStep.commandComplete(self, cmd) | 1083 return ProcessLogShellStep.commandComplete(self, cmd) |
| OLD | NEW |