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

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

Issue 2544173002: Skip commits that don't generate a patch + fixes to get export working (Closed)
Patch Set: Refactor TestExporter, clean up other parts Created 4 years 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
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.common.memoized import memoized 5 from webkitpy.common.memoized import memoized
6 from webkitpy.common.webkit_finder import WebKitFinder 6 from webkitpy.common.webkit_finder import WebKitFinder
7 7
8 WPT_DIR = 'third_party/WebKit/LayoutTests/imported/wpt/'
9
8 10
9 class ChromiumCommit(object): 11 class ChromiumCommit(object):
10 12
11 def __init__(self, host, sha=None, position=None): 13 def __init__(self, host, sha=None, position=None):
12 """ 14 """
13 Args: 15 Args:
14 host: A Host object 16 host: A Host object
15 sha: A Chromium commit SHA 17 sha: A Chromium commit SHA
16 position: A string of the form: 18 position: A string of the form:
17 'Cr-Commit-Position: refs/heads/master@{#431915}' 19 'Cr-Commit-Position: refs/heads/master@{#431915}'
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 ]) 58 ])
57 59
58 def message(self): 60 def message(self):
59 """Returns a string with a commit's subject and body.""" 61 """Returns a string with a commit's subject and body."""
60 return self.host.executive.run_command([ 62 return self.host.executive.run_command([
61 'git', 'show', '--format=%B', '--no-patch', self.sha 63 'git', 'show', '--format=%B', '--no-patch', self.sha
62 ]) 64 ])
63 65
64 def format_patch(self): 66 def format_patch(self):
65 """Makes a patch with just changes in files in the WPT for a given commi t.""" 67 """Makes a patch with just changes in files in the WPT for a given commi t."""
68
69 # Get list of changed files
qyearsley 2016/12/07 19:05:36 Nit: Add periods at the end of comments that are f
70 changed_files = self.host.executive.run_command([
71 'git', 'diff-tree', '--name-only', '--no-commit-id', '-r', self.sha,
72 '--', self.absolute_chromium_wpt_dir()
73 ]).splitlines()
74
75 # Remove files on blacklist (MANIFEST.json)
66 # TODO(jeffcarp): exclude expectations files 76 # TODO(jeffcarp): exclude expectations files
67 # TODO(jeffcarp): exclude manifest files 77 blacklist = ['MANIFEST.json']
78 qualified_blacklist = [WPT_DIR + f for f in blacklist]
79 filtered_files = [f for f in changed_files if f not in qualified_blackli st]
80
81 # Pass those files to format-patch
68 return self.host.executive.run_command([ 82 return self.host.executive.run_command([
69 'git', 'format-patch', '-1', '--stdout', 83 'git', 'format-patch', '-1', '--stdout',
70 self.sha, self.absolute_chromium_wpt_dir() 84 self.sha, '--'
71 ]) 85 ] + filtered_files, cwd=self.absolute_chromium_dir())
72 86
73 @memoized 87 @memoized
74 def absolute_chromium_wpt_dir(self): 88 def absolute_chromium_wpt_dir(self):
75 finder = WebKitFinder(self.host.filesystem) 89 finder = WebKitFinder(self.host.filesystem)
76 return finder.path_from_webkit_base('LayoutTests', 'imported', 'wpt') 90 return finder.path_from_webkit_base('LayoutTests', 'imported', 'wpt')
91
92 @memoized
93 def absolute_chromium_dir(self):
94 finder = WebKitFinder(self.host.filesystem)
95 return finder.chromium_base()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698