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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit.py
index f87cb43cd21552d27d9a21fb4265e8c312794431..8eef0a28923951da1b8ed4b4a05958ac2ff41609 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit.py
@@ -5,6 +5,8 @@
from webkitpy.common.memoized import memoized
from webkitpy.common.webkit_finder import WebKitFinder
+WPT_DIR = 'third_party/WebKit/LayoutTests/imported/wpt/'
+
class ChromiumCommit(object):
@@ -63,14 +65,31 @@ class ChromiumCommit(object):
def format_patch(self):
"""Makes a patch with just changes in files in the WPT for a given commit."""
+
+ # Get list of changed files
qyearsley 2016/12/07 19:05:36 Nit: Add periods at the end of comments that are f
+ changed_files = self.host.executive.run_command([
+ 'git', 'diff-tree', '--name-only', '--no-commit-id', '-r', self.sha,
+ '--', self.absolute_chromium_wpt_dir()
+ ]).splitlines()
+
+ # Remove files on blacklist (MANIFEST.json)
# TODO(jeffcarp): exclude expectations files
- # TODO(jeffcarp): exclude manifest files
+ blacklist = ['MANIFEST.json']
+ qualified_blacklist = [WPT_DIR + f for f in blacklist]
+ filtered_files = [f for f in changed_files if f not in qualified_blacklist]
+
+ # Pass those files to format-patch
return self.host.executive.run_command([
'git', 'format-patch', '-1', '--stdout',
- self.sha, self.absolute_chromium_wpt_dir()
- ])
+ self.sha, '--'
+ ] + filtered_files, cwd=self.absolute_chromium_dir())
@memoized
def absolute_chromium_wpt_dir(self):
finder = WebKitFinder(self.host.filesystem)
return finder.path_from_webkit_base('LayoutTests', 'imported', 'wpt')
+
+ @memoized
+ def absolute_chromium_dir(self):
+ finder = WebKitFinder(self.host.filesystem)
+ return finder.chromium_base()

Powered by Google App Engine
This is Rietveld 408576698