| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Fetches a copy of the latest state of a W3C test repository and commits. | 5 """Fetches a copy of the latest state of a W3C test repository and commits. |
| 6 | 6 |
| 7 If this script is given the argument --auto-update, it will also attempt to | 7 If this script is given the argument --auto-update, it will also attempt to |
| 8 upload a CL, triggery try jobs, and make any changes that are required for | 8 upload a CL, triggery try jobs, and make any changes that are required for |
| 9 new failing tests before committing. | 9 new failing tests before committing. |
| 10 """ | 10 """ |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 return False | 291 return False |
| 292 return True | 292 return True |
| 293 | 293 |
| 294 def get_directory_owners_to_cc(self): | 294 def get_directory_owners_to_cc(self): |
| 295 """Returns a list of email addresses to CC for the current import.""" | 295 """Returns a list of email addresses to CC for the current import.""" |
| 296 self.print_('## Gathering directory owners emails to CC.') | 296 self.print_('## Gathering directory owners emails to CC.') |
| 297 directory_owners_file_path = self.finder.path_from_webkit_base( | 297 directory_owners_file_path = self.finder.path_from_webkit_base( |
| 298 'Tools', 'Scripts', 'webkitpy', 'w3c', 'directory_owners.json') | 298 'Tools', 'Scripts', 'webkitpy', 'w3c', 'directory_owners.json') |
| 299 with open(directory_owners_file_path) as data_file: | 299 with open(directory_owners_file_path) as data_file: |
| 300 directory_to_owner = self.parse_directory_owners(json.load(data_file
)) | 300 directory_to_owner = self.parse_directory_owners(json.load(data_file
)) |
| 301 out = self.check_run(['git', 'diff', 'master', '--name-only']) | 301 out = self.check_run(['git', 'diff', 'origin/master', '--name-only']) |
| 302 changed_files = out.splitlines() | 302 changed_files = out.splitlines() |
| 303 return self.generate_email_list(changed_files, directory_to_owner) | 303 return self.generate_email_list(changed_files, directory_to_owner) |
| 304 | 304 |
| 305 @staticmethod | 305 @staticmethod |
| 306 def parse_directory_owners(decoded_data_file): | 306 def parse_directory_owners(decoded_data_file): |
| 307 directory_dict = {} | 307 directory_dict = {} |
| 308 for dict_set in decoded_data_file: | 308 for dict_set in decoded_data_file: |
| 309 if dict_set['notification-email']: | 309 if dict_set['notification-email']: |
| 310 directory_dict[dict_set['directory']] = dict_set['notification-e
mail'] | 310 directory_dict[dict_set['directory']] = dict_set['notification-e
mail'] |
| 311 return directory_dict | 311 return directory_dict |
| (...skipping 20 matching lines...) Expand all Loading... |
| 332 email_addresses.add(directory_to_owner[test_dir]) | 332 email_addresses.add(directory_to_owner[test_dir]) |
| 333 return sorted(email_addresses) | 333 return sorted(email_addresses) |
| 334 | 334 |
| 335 def write_test_expectations(self): | 335 def write_test_expectations(self): |
| 336 self.print_('## Adding test expectations lines to LayoutTests/TestExpect
ations.') | 336 self.print_('## Adding test expectations lines to LayoutTests/TestExpect
ations.') |
| 337 script_path = self.path_from_webkit_base('Tools', 'Scripts', 'update-w3c
-test-expectations') | 337 script_path = self.path_from_webkit_base('Tools', 'Scripts', 'update-w3c
-test-expectations') |
| 338 self.run([self.host.executable, script_path]) | 338 self.run([self.host.executable, script_path]) |
| 339 message = '\'Modifies TestExpectations and/or downloads new baselines fo
r tests\'' | 339 message = '\'Modifies TestExpectations and/or downloads new baselines fo
r tests\'' |
| 340 self.check_run(['git', 'commit', '-a', '-m', message]) | 340 self.check_run(['git', 'commit', '-a', '-m', message]) |
| 341 self.git_cl(['upload', '-m', message, '--rietveld']) | 341 self.git_cl(['upload', '-m', message, '--rietveld']) |
| OLD | NEW |