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

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

Issue 2692233002: [WPT Export] Fix cwd on run_command calls in ChromiumCommit (Closed)
Patch Set: Strictly assert that SHA-1 hash was passed to ChromiumCommit Created 3 years, 10 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 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 76e48ec83bd7a21ae46024d2ffe474c07c1d8d9a..efa62248c093e67d83bd8d9ed0aa9ef6949bc941 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/chromium_commit.py
@@ -31,6 +31,7 @@ class ChromiumCommit(object):
sha = self.position_to_sha(position)
+ assert len(sha) == 40, 'Expected SHA-1 hash, got {}'.format(sha)
self.sha = sha
self.position = position
@@ -40,40 +41,40 @@ class ChromiumCommit(object):
"""
return len(self.host.executive.run_command([
'git', 'rev-list', '{}..origin/master'.format(self.sha)
- ]).splitlines())
+ ], cwd=self.absolute_chromium_dir()).splitlines())
def position_to_sha(self, commit_position):
return self.host.executive.run_command([
'git', 'crrev-parse', commit_position
- ]).strip()
+ ], cwd=self.absolute_chromium_dir()).strip()
def subject(self):
return self.host.executive.run_command([
'git', 'show', '--format=%s', '--no-patch', self.sha
- ])
+ ], cwd=self.absolute_chromium_dir())
def body(self):
return self.host.executive.run_command([
'git', 'show', '--format=%b', '--no-patch', self.sha
- ])
+ ], cwd=self.absolute_chromium_dir())
def author(self):
return self.host.executive.run_command([
'git', 'show', '--format="%aN <%aE>"', '--no-patch', self.sha
- ])
+ ], cwd=self.absolute_chromium_dir())
def message(self):
"""Returns a string with a commit's subject and body."""
return self.host.executive.run_command([
'git', 'show', '--format=%B', '--no-patch', self.sha
- ])
+ ], cwd=self.absolute_chromium_dir())
def filtered_changed_files(self):
"""Makes a patch with just changes in files in the WPT dir for a given commit."""
changed_files = self.host.executive.run_command([
'git', 'diff-tree', '--name-only', '--no-commit-id', '-r', self.sha,
'--', self.absolute_chromium_wpt_dir()
- ]).splitlines()
+ ], cwd=self.absolute_chromium_dir()).splitlines()
blacklist = [
'MANIFEST.json',

Powered by Google App Engine
This is Rietveld 408576698