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

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

Issue 2518313003: Refactor WPT Export to ensure only one PR in flight at a time (Closed)
Patch Set: Delete two unrelated files 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.webkit_finder import WebKitFinder
6
5 7
6 class ChromiumCommit(object): 8 class ChromiumCommit(object):
7 9
8 def __init__(self, host, sha=None, position=None): 10 def __init__(self, host, sha=None, position=None):
9 """ 11 """
10 Args: 12 Args:
11 host: A Host object 13 host: A Host object
12 sha: A Chromium commit SHA 14 sha: A Chromium commit SHA
13 position: A string of the form: 15 position: A string of the form:
14 'Cr-Commit-Position: refs/heads/master@{#431915}' 16 'Cr-Commit-Position: refs/heads/master@{#431915}'
(...skipping 29 matching lines...) Expand all
44 46
45 def subject(self): 47 def subject(self):
46 return self.host.executive.run_command([ 48 return self.host.executive.run_command([
47 'git', 'show', '--format=%s', '--no-patch', self.sha 49 'git', 'show', '--format=%s', '--no-patch', self.sha
48 ]) 50 ])
49 51
50 def body(self): 52 def body(self):
51 return self.host.executive.run_command([ 53 return self.host.executive.run_command([
52 'git', 'show', '--format=%b', '--no-patch', self.sha 54 'git', 'show', '--format=%b', '--no-patch', self.sha
53 ]) 55 ])
56
57 def message(self):
58 """Returns a string with a commit's subject and body."""
59 return self.host.executive.run_command([
60 'git', 'show', '--format=%B', '--no-patch', self.sha
61 ])
62
63 def format_patch(self):
64 """Makes a patch with just changes in files in the WPT for a given commi t."""
65 # TODO(jeffcarp): do not include expectations files
66 return self.host.executive.run_command([
67 'git', 'format-patch', '-1', '--stdout',
68 self.sha, self.absolute_chromium_wpt_dir()
69 ])
70
71 @memoized
72 def absolute_chromium_wpt_dir(self):
73 finder = WebKitFinder(self.host.filesystem)
74 return finder.path_from_webkit_base('LayoutTests', 'imported', 'wpt')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698