| 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 """Utility functions used both when importing and exporting.""" | 5 """Utility functions used both when importing and exporting.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 | 8 |
| 9 from webkitpy.w3c.chromium_commit import ChromiumCommit | 9 from webkitpy.w3c.chromium_commit import ChromiumCommit |
| 10 from webkitpy.w3c.chromium_finder import absolute_chromium_dir | 10 from webkitpy.w3c.chromium_finder import absolute_chromium_dir |
| 11 | 11 |
| 12 | 12 |
| 13 WPT_DEST_NAME = 'wpt' | 13 WPT_DEST_NAME = 'wpt' |
| 14 CSS_DEST_NAME = 'csswg-test' | 14 CSS_DEST_NAME = 'csswg-test' |
| 15 WPT_GH_REPO_URL = 'git@github.com:w3c/web-platform-tests.git' |
| 15 | 16 |
| 16 # TODO(qyearsley): This directory should be able to be constructed with | 17 # TODO(qyearsley): This directory should be able to be constructed with |
| 17 # WebKitFinder and WPT_DEST_NAME, plus the string "external". | 18 # WebKitFinder and WPT_DEST_NAME, plus the string "external". |
| 18 CHROMIUM_WPT_DIR = 'third_party/WebKit/LayoutTests/external/wpt/' | 19 CHROMIUM_WPT_DIR = 'third_party/WebKit/LayoutTests/external/wpt/' |
| 19 | 20 |
| 20 # Our mirrors of the official w3c repos, which we pull from. | 21 # Our mirrors of the official w3c repos, which we pull from. |
| 21 WPT_REPO_URL = 'https://chromium.googlesource.com/external/w3c/web-platform-test
s.git' | 22 WPT_REPO_URL = 'https://chromium.googlesource.com/external/w3c/web-platform-test
s.git' |
| 22 CSS_REPO_URL = 'https://chromium.googlesource.com/external/w3c/csswg-test.git' | 23 CSS_REPO_URL = 'https://chromium.googlesource.com/external/w3c/csswg-test.git' |
| 23 | 24 |
| 25 |
| 24 _log = logging.getLogger(__name__) | 26 _log = logging.getLogger(__name__) |
| 25 | 27 |
| 26 | 28 |
| 27 def exportable_commits_since(chromium_commit_hash, host, local_wpt): | 29 def exportable_commits_since(chromium_commit_hash, host, local_wpt): |
| 28 """Lists exportable commits after a certain point. | 30 """Lists exportable commits after a certain point. |
| 29 | 31 |
| 30 Args: | 32 Args: |
| 31 chromium_commit_hash: The SHA of the Chromium commit from which this | 33 chromium_commit_hash: The SHA of the Chromium commit from which this |
| 32 method will look. This commit is not included in the commits searche
d. | 34 method will look. This commit is not included in the commits searche
d. |
| 33 host: A Host object. | 35 host: A Host object. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 51 return [commit for commit in chromium_commits if is_exportable(commit, local
_wpt)] | 53 return [commit for commit in chromium_commits if is_exportable(commit, local
_wpt)] |
| 52 | 54 |
| 53 | 55 |
| 54 def is_exportable(chromium_commit, local_wpt): | 56 def is_exportable(chromium_commit, local_wpt): |
| 55 """Checks whether a given patch is exportable and can be applied.""" | 57 """Checks whether a given patch is exportable and can be applied.""" |
| 56 patch = chromium_commit.format_patch() | 58 patch = chromium_commit.format_patch() |
| 57 return ('NOEXPORT=true' not in chromium_commit.message() and | 59 return ('NOEXPORT=true' not in chromium_commit.message() and |
| 58 not chromium_commit.message().startswith('Import ') and | 60 not chromium_commit.message().startswith('Import ') and |
| 59 patch and | 61 patch and |
| 60 local_wpt.test_patch(patch, chromium_commit)) | 62 local_wpt.test_patch(patch, chromium_commit)) |
| OLD | NEW |