Chromium Code Reviews| 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 utility class for interacting with the Chromium git tree | 5 """A utility class for interacting with the Chromium git tree |
| 6 for use cases relating to the Web Platform Tests. | 6 for use cases relating to the Web Platform Tests. |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 CHROMIUM_WPT_DIR = 'third_party/WebKit/LayoutTests/imported/wpt/' | 9 CHROMIUM_WPT_DIR = 'third_party/WebKit/LayoutTests/imported/wpt/' |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 def exportable_commits_since(self, commit): | 26 def exportable_commits_since(self, commit): |
| 27 toplevel = self.host.executive.run_command([ | 27 toplevel = self.host.executive.run_command([ |
| 28 'git', 'rev-parse', '--show-toplevel' | 28 'git', 'rev-parse', '--show-toplevel' |
| 29 ]).strip() | 29 ]).strip() |
| 30 | 30 |
| 31 commits = self.host.executive.run_command([ | 31 commits = self.host.executive.run_command([ |
| 32 'git', 'rev-list', '{}..HEAD'.format(commit), | 32 'git', 'rev-list', '{}..HEAD'.format(commit), |
| 33 '--', toplevel + '/' + CHROMIUM_WPT_DIR | 33 '--', toplevel + '/' + CHROMIUM_WPT_DIR |
| 34 ]).splitlines() | 34 ]).splitlines() |
| 35 | 35 |
| 36 # TODO(jeffcarp): this is temporary until I solve | 36 # TODO(jeffcarp): allow this logic to be shared |
| 37 # the import/export differentiation problem | |
| 38 def is_exportable(chromium_commit): | 37 def is_exportable(chromium_commit): |
| 38 message = self.message(chromium_commit) | |
| 39 return ( | 39 return ( |
| 40 'export' in self.message(chromium_commit) | 40 'NOEXPORT=true' not in message |
| 41 and not message.startswith('Import ') | |
|
foolip
2016/11/29 11:12:20
Is the 'Import ' check still needed?
jeffcarp
2016/11/29 19:00:48
At the moment it's needed to ignore Import commits
| |
| 42 # TODO(jeffcarp): change this to allow any commit with | |
| 43 # any non-expectation changes to be exportable | |
| 44 and not self._has_expectations(chromium_commit) | |
| 41 ) | 45 ) |
| 42 | 46 |
| 43 return filter(is_exportable, commits) | 47 return filter(is_exportable, commits) |
| 44 | 48 |
| 45 def _has_expectations(self, chromium_commit): | 49 def _has_expectations(self, chromium_commit): |
| 46 files = self.host.executive.run_command([ | 50 files = self.host.executive.run_command([ |
| 47 'git', 'diff-tree', '--no-commit-id', | 51 'git', 'diff-tree', '--no-commit-id', |
| 48 '--name-only', '-r', chromium_commit | 52 '--name-only', '-r', chromium_commit |
| 49 ]).splitlines() | 53 ]).splitlines() |
| 50 | 54 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 77 @memoized | 81 @memoized |
| 78 def absolute_chromium_wpt_dir(self): | 82 def absolute_chromium_wpt_dir(self): |
| 79 finder = WebKitFinder(self.host.filesystem) | 83 finder = WebKitFinder(self.host.filesystem) |
| 80 return finder.path_from_webkit_base('LayoutTests', 'imported', 'wpt') | 84 return finder.path_from_webkit_base('LayoutTests', 'imported', 'wpt') |
| 81 | 85 |
| 82 # TODO(jeffcarp): this is duplicated in LocalWPT, maybe move into a GitRepo base class? | 86 # TODO(jeffcarp): this is duplicated in LocalWPT, maybe move into a GitRepo base class? |
| 83 def commits_behind_master(self, commit): | 87 def commits_behind_master(self, commit): |
| 84 return len(self.host.executive.run_command([ | 88 return len(self.host.executive.run_command([ |
| 85 'git', 'rev-list', '{}..origin/master'.format(commit) | 89 'git', 'rev-list', '{}..origin/master'.format(commit) |
| 86 ]).splitlines()) | 90 ]).splitlines()) |
| OLD | NEW |