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 """Set of utilities to add commands to a buildbot factory (BuildFactory). | 5 """Set of utilities to add commands to a buildbot factory (BuildFactory). |
| 6 | 6 |
| 7 All the utility functions to add steps to a build factory here are not | 7 All the utility functions to add steps to a build factory here are not |
| 8 project-specific. See the other *_commands.py for project-specific commands. | 8 project-specific. See the other *_commands.py for project-specific commands. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 928 command=cmd) | 928 command=cmd) |
| 929 | 929 |
| 930 def AddBotUpdateStep(self, env, gclient_specs, revision_mapping, server=None): | 930 def AddBotUpdateStep(self, env, gclient_specs, revision_mapping, server=None): |
| 931 """Add a step to force checkout to some state. | 931 """Add a step to force checkout to some state. |
| 932 | 932 |
| 933 This is meant to replace all gclient revert/sync steps. | 933 This is meant to replace all gclient revert/sync steps. |
| 934 """ | 934 """ |
| 935 cmd = ['python', self._bot_update_tool, '--specs', gclient_specs] | 935 cmd = ['python', self._bot_update_tool, '--specs', gclient_specs] |
| 936 | 936 |
| 937 PROPERTIES = { | 937 PROPERTIES = { |
| 938 'root': '%(root:~src)s', | 938 'root': '%(root:~src)s', |
|
iannucci
2014/02/08 01:31:31
I'm not sure if the default of 'src' is really goo
Ryan Tseng
2014/02/08 01:52:21
Done.
| |
| 939 'issue': '%(issue:-)s', | 939 'issue': '%(issue:-)s', |
| 940 'patchset': '%(patchset:-)s', | 940 'patchset': '%(patchset:-)s', |
| 941 'master': '%(mastername:-)s' | 941 'master': '%(mastername:-)s', |
| 942 'revision': '%(revision:-)s', | |
|
iannucci
2014/02/08 01:31:31
this should also pass through patch_url if it's de
Ryan Tseng
2014/02/08 01:52:21
Done.
| |
| 942 } | 943 } |
| 943 | 944 |
| 944 for property_name, property_expr in PROPERTIES.iteritems(): | 945 for property_name, property_expr in PROPERTIES.iteritems(): |
| 945 property_value = WithProperties(property_expr) | 946 property_value = WithProperties(property_expr) |
| 946 if property_value: | 947 if property_value: |
| 947 cmd.extend(['--%s' % property_name, property_value]) | 948 cmd.extend(['--%s' % property_name, property_value]) |
| 948 | 949 |
| 949 if server: | 950 if server: |
| 950 cmd.extend(['--server', server]) | 951 cmd.extend(['--server', server]) |
| 951 | 952 |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1295 | 1296 |
| 1296 def commandComplete(self, cmd): | 1297 def commandComplete(self, cmd): |
| 1297 out = cmd.logs['stdio'].getText() | 1298 out = cmd.logs['stdio'].getText() |
| 1298 build_properties = re.findall('BUILD_PROPERTY ([^=]*)=(.*)', out) | 1299 build_properties = re.findall('BUILD_PROPERTY ([^=]*)=(.*)', out) |
| 1299 for propname, value in build_properties: | 1300 for propname, value in build_properties: |
| 1300 # findall can return strings containing CR characters, remove with strip. | 1301 # findall can return strings containing CR characters, remove with strip. |
| 1301 self.build.setProperty(propname, value.strip(), 'Step') | 1302 self.build.setProperty(propname, value.strip(), 'Step') |
| 1302 | 1303 |
| 1303 def getText(self, cmd, results): | 1304 def getText(self, cmd, results): |
| 1304 return self.describe(True) + self.messages | 1305 return self.describe(True) + self.messages |
| OLD | NEW |