OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 """A command to download new baselines for NeedsRebaseline tests. | 5 """A command to download new baselines for NeedsRebaseline tests. |
6 | 6 |
7 This command checks the list of tests with NeedsRebaseline expectations, | 7 This command checks the list of tests with NeedsRebaseline expectations, |
8 and downloads the latest baselines for those tests from the results archived | 8 and downloads the latest baselines for those tests from the results archived |
9 by the continuous builders. | 9 by the continuous builders. |
10 """ | 10 """ |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 def tree_status(): | 203 def tree_status(): |
204 blink_tree_status_url = "http://chromium-status.appspot.com/status" | 204 blink_tree_status_url = "http://chromium-status.appspot.com/status" |
205 status = urllib2.urlopen(blink_tree_status_url).read().lower() | 205 status = urllib2.urlopen(blink_tree_status_url).read().lower() |
206 if 'closed' in status or status == "0": | 206 if 'closed' in status or status == "0": |
207 return 'closed' | 207 return 'closed' |
208 elif 'open' in status or status == "1": | 208 elif 'open' in status or status == "1": |
209 return 'open' | 209 return 'open' |
210 return 'unknown' | 210 return 'unknown' |
211 | 211 |
212 def execute(self, options, args, tool): | 212 def execute(self, options, args, tool): |
| 213 self._tool = tool |
213 if tool.scm().executable_name == "svn": | 214 if tool.scm().executable_name == "svn": |
214 _log.error("Auto rebaseline only works with a git checkout.") | 215 _log.error("Auto rebaseline only works with a git checkout.") |
215 return | 216 return |
216 | 217 |
217 if not options.dry_run and tool.scm().has_working_directory_changes(): | 218 if not options.dry_run and tool.scm().has_working_directory_changes(): |
218 _log.error("Cannot proceed with working directory changes. Clean wor
king directory first.") | 219 _log.error("Cannot proceed with working directory changes. Clean wor
king directory first.") |
219 return | 220 return |
220 | 221 |
221 revision_data = self.bot_revision_data(tool.scm()) | 222 revision_data = self.bot_revision_data(tool.scm()) |
222 if not revision_data: | 223 if not revision_data: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 issue_already_closed = tool.executive.run_command( | 289 issue_already_closed = tool.executive.run_command( |
289 ['git', 'config', 'branch.%s.rietveldissue' % rebaseline
_branch_name], | 290 ['git', 'config', 'branch.%s.rietveldissue' % rebaseline
_branch_name], |
290 return_exit_code=True) | 291 return_exit_code=True) |
291 if not issue_already_closed: | 292 if not issue_already_closed: |
292 self._run_git_cl_command(options, ['set_close']) | 293 self._run_git_cl_command(options, ['set_close']) |
293 | 294 |
294 tool.scm().ensure_cleanly_tracking_remote_master() | 295 tool.scm().ensure_cleanly_tracking_remote_master() |
295 if old_branch_name_or_ref: | 296 if old_branch_name_or_ref: |
296 tool.scm().checkout_branch(old_branch_name_or_ref) | 297 tool.scm().checkout_branch(old_branch_name_or_ref) |
297 tool.scm().delete_branch(rebaseline_branch_name) | 298 tool.scm().delete_branch(rebaseline_branch_name) |
OLD | NEW |