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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit.py

Issue 2779053002: Ignore OWNERS files during external/wpt import and export (Closed)
Patch Set: Addressed comments Created 3 years, 8 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 from webkitpy.w3c.chromium_finder import absolute_chromium_dir, absolute_chromiu m_wpt_dir 5 from webkitpy.w3c.chromium_finder import absolute_chromium_dir, absolute_chromiu m_wpt_dir
6 6
7 CHROMIUM_WPT_DIR = 'third_party/WebKit/LayoutTests/external/wpt/' 7 CHROMIUM_WPT_DIR = 'third_party/WebKit/LayoutTests/external/wpt/'
8 8
9 9
10 class ChromiumCommit(object): 10 class ChromiumCommit(object):
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 'git', 'diff-tree', '--name-only', '--no-commit-id', '-r', self.sha, 80 'git', 'diff-tree', '--name-only', '--no-commit-id', '-r', self.sha,
81 '--', self.absolute_chromium_wpt_dir 81 '--', self.absolute_chromium_wpt_dir
82 ], cwd=self.absolute_chromium_dir).splitlines() 82 ], cwd=self.absolute_chromium_dir).splitlines()
83 83
84 blacklist = [ 84 blacklist = [
85 'MANIFEST.json', 85 'MANIFEST.json',
86 self.host.filesystem.join('resources', 'testharnessreport.js'), 86 self.host.filesystem.join('resources', 'testharnessreport.js'),
87 ] 87 ]
88 qualified_blacklist = [CHROMIUM_WPT_DIR + f for f in blacklist] 88 qualified_blacklist = [CHROMIUM_WPT_DIR + f for f in blacklist]
89 89
90 return [f for f in changed_files if f not in qualified_blacklist and not self.is_baseline(f)] 90 is_ignored = lambda f: (
91 f in qualified_blacklist or
92 self.is_baseline(f) or
93 # See http://crbug.com/702283 for context.
94 self.host.filesystem.basename(f) == 'OWNERS')
95 return [f for f in changed_files if not is_ignored(f)]
91 96
92 @staticmethod 97 @staticmethod
93 def is_baseline(basename): 98 def is_baseline(basename):
94 # TODO(qyearsley): Find a better, centralized place for this. 99 # TODO(qyearsley): Find a better, centralized place for this.
95 return basename.endswith('-expected.txt') 100 return basename.endswith('-expected.txt')
96 101
97 def format_patch(self): 102 def format_patch(self):
98 """Makes a patch with only exportable changes.""" 103 """Makes a patch with only exportable changes."""
99 filtered_files = self.filtered_changed_files() 104 filtered_files = self.filtered_changed_files()
100 105
101 if not filtered_files: 106 if not filtered_files:
102 return '' 107 return ''
103 108
104 return self.host.executive.run_command([ 109 return self.host.executive.run_command([
105 'git', 'format-patch', '-1', '--stdout', self.sha, '--' 110 'git', 'format-patch', '-1', '--stdout', self.sha, '--'
106 ] + filtered_files, cwd=self.absolute_chromium_dir) 111 ] + filtered_files, cwd=self.absolute_chromium_dir)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698