Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py

Issue 2590693002: Only add unstaged baseline changes to the git index when rebaselining. (Closed)
Patch Set: rebaseline-cl: Abort if there are unstaged baseline changes. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 fetch new baselines from try jobs for a Rietveld issue. 5 """A command to fetch new baselines from try jobs for a Rietveld issue.
6 6
7 This command interacts with the Rietveld API to get information about try jobs 7 This command interacts with the Rietveld API to get information about try jobs
8 with layout test results. 8 with layout test results.
9 """ 9 """
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 optparse.make_option( 45 optparse.make_option(
46 '--no-trigger-jobs', dest='trigger_jobs', action='store_false', default=True, 46 '--no-trigger-jobs', dest='trigger_jobs', action='store_false', default=True,
47 help='Do not trigger any try jobs.'), 47 help='Do not trigger any try jobs.'),
48 self.no_optimize_option, 48 self.no_optimize_option,
49 self.results_directory_option, 49 self.results_directory_option,
50 ]) 50 ])
51 self.rietveld = Rietveld(Web()) 51 self.rietveld = Rietveld(Web())
52 52
53 def execute(self, options, args, tool): 53 def execute(self, options, args, tool):
54 self._tool = tool 54 self._tool = tool
55
56 unstaged_baselines = self.unstaged_baselines()
57 if unstaged_baselines:
58 _log.error('Aborting: there are unstaged baselines:')
59 for path in unstaged_baselines:
60 _log.error(' %s', path)
61 return
62
55 issue_number = self._get_issue_number(options) 63 issue_number = self._get_issue_number(options)
56 if not issue_number: 64 if not issue_number:
57 return 65 return
58 66
67 # TODO(qyearsley): Replace this with git cl try-results to remove
68 # dependency on Rietveld. See crbug.com/671684.
59 builds = self.rietveld.latest_try_jobs(issue_number, self._try_bots()) 69 builds = self.rietveld.latest_try_jobs(issue_number, self._try_bots())
60 70
61 if options.trigger_jobs: 71 if options.trigger_jobs:
62 if self.trigger_jobs_for_missing_builds(builds): 72 if self.trigger_jobs_for_missing_builds(builds):
63 _log.info('Please re-run webkit-patch rebaseline-cl once all pen ding try jobs have finished.') 73 _log.info('Please re-run webkit-patch rebaseline-cl once all pen ding try jobs have finished.')
64 return 74 return
65 if not builds: 75 if not builds:
66 _log.info('No builds to download baselines from.') 76 _log.info('No builds to download baselines from.')
67 77
68 _log.debug('Getting results for Rietveld issue %d.', issue_number) 78 _log.debug('Getting results for Rietveld issue %d.', issue_number)
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 def _log_test_prefix_list(test_prefix_list): 237 def _log_test_prefix_list(test_prefix_list):
228 """Logs the tests to download new baselines for.""" 238 """Logs the tests to download new baselines for."""
229 if not test_prefix_list: 239 if not test_prefix_list:
230 _log.info('No tests to rebaseline; exiting.') 240 _log.info('No tests to rebaseline; exiting.')
231 return 241 return
232 _log.debug('Tests to rebaseline:') 242 _log.debug('Tests to rebaseline:')
233 for test, builds in test_prefix_list.iteritems(): 243 for test, builds in test_prefix_list.iteritems():
234 _log.debug(' %s:', test) 244 _log.debug(' %s:', test)
235 for build in sorted(builds): 245 for build in sorted(builds):
236 _log.debug(' %s', build) 246 _log.debug(' %s', build)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698