| 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 script for exporting and importing changes between the Chromium repo | 5 """A script for exporting and importing changes between the Chromium repo |
| 6 and the web-platform-tests repo. | 6 and the web-platform-tests repo. |
| 7 | 7 |
| 8 TODO(jeffcarp): does not handle reverted changes right now | 8 TODO(jeffcarp): does not handle reverted changes right now |
| 9 TODO(jeffcarp): it also doesn't handle changes to -expected.html files | 9 TODO(jeffcarp): it also doesn't handle changes to -expected.html files |
| 10 TODO(jeffcarp): Currently this script only does export; also add an option | 10 TODO(jeffcarp): Currently this script only does export; also add an option |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 exportable_commits = chromium_wpt.exportable_commits_since(chromium_commit.s
ha) | 45 exportable_commits = chromium_wpt.exportable_commits_since(chromium_commit.s
ha) |
| 46 | 46 |
| 47 if exportable_commits: | 47 if exportable_commits: |
| 48 _log.info('Found %s exportable commits in chromium:', len(exportable_com
mits)) | 48 _log.info('Found %s exportable commits in chromium:', len(exportable_com
mits)) |
| 49 for commit in exportable_commits: | 49 for commit in exportable_commits: |
| 50 _log.info('- %s %s', commit, chromium_wpt.subject(commit)) | 50 _log.info('- %s %s', commit, chromium_wpt.subject(commit)) |
| 51 else: | 51 else: |
| 52 _log.info('No exportable commits found in Chromium, stopping.') | 52 _log.info('No exportable commits found in Chromium, stopping.') |
| 53 return | 53 return |
| 54 | 54 |
| 55 if options.status: |
| 56 return |
| 57 |
| 58 # should no longer iterate through all of them |
| 59 # should at most one of these per process: |
| 60 # - create a PR |
| 61 # - check a PR status (and merge if green) |
| 55 for commit in exportable_commits: | 62 for commit in exportable_commits: |
| 56 _log.info('Uploading %s', chromium_wpt.subject(commit)) | 63 _log.info('Uploading %s', chromium_wpt.subject(commit)) |
| 57 chromium_commit = ChromiumCommit(host, sha=commit) | 64 chromium_commit = ChromiumCommit(host, sha=commit) |
| 58 | 65 |
| 59 patch = chromium_wpt.format_patch(commit) | 66 patch = chromium_wpt.format_patch(commit) |
| 60 message = chromium_wpt.message(commit) | 67 message = chromium_wpt.message(commit) |
| 61 | 68 |
| 62 local_wpt.create_branch_with_patch(branch_name, message, patch) | 69 local_wpt.create_branch_with_patch(branch_name, message, patch) |
| 63 | 70 |
| 64 github.create_pr( | 71 github.create_pr( |
| 65 local_branch_name='chromium-try-{}'.format(commit), | 72 local_branch_name='chromium-try-{}'.format(commit), |
| 66 desc_title=chromium_commit.subject(), | 73 desc_title=chromium_commit.subject(), |
| 67 body=chromium_commit.body()) | 74 body=chromium_commit.body()) |
| 68 | 75 |
| 69 | 76 |
| 70 def parse_args(): | 77 def parse_args(): |
| 71 parser = argparse.ArgumentParser(description='WPT Sync') | 78 parser = argparse.ArgumentParser(description='WPT Sync') |
| 72 parser.add_argument('--no-fetch', action='store_true') | 79 parser.add_argument('--no-fetch', action='store_true') |
| 80 parser.add_argument('--status', action='store_true') |
| 73 return parser.parse_args() | 81 return parser.parse_args() |
| OLD | NEW |