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

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

Issue 2658713002: [WPT Export] Add merge_method: rebase to WPTGitHub.merge_pull_request (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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 import base64 5 import base64
6 import json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import sys 9 import sys
10 import urllib2 10 import urllib2
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 def in_flight_pull_requests(self): 80 def in_flight_pull_requests(self):
81 path = '/search/issues?q=repo:w3c/web-platform-tests%20is:open%20type:pr %20label:{}'.format(EXPORT_LABEL) 81 path = '/search/issues?q=repo:w3c/web-platform-tests%20is:open%20type:pr %20label:{}'.format(EXPORT_LABEL)
82 data, status_code = self.request(path, method='GET') 82 data, status_code = self.request(path, method='GET')
83 if status_code == 200: 83 if status_code == 200:
84 return data['items'] 84 return data['items']
85 else: 85 else:
86 raise Exception('Non-200 status code (%s): %s' % (status_code, data) ) 86 raise Exception('Non-200 status code (%s): %s' % (status_code, data) )
87 87
88 def merge_pull_request(self, pull_request_number): 88 def merge_pull_request(self, pull_request_number):
89 path = '/repos/w3c/web-platform-tests/pulls/%d/merge' % pull_request_num ber 89 path = '/repos/w3c/web-platform-tests/pulls/%d/merge' % pull_request_num ber
90 body = {} 90 body = {
91 'merge_method': 'rebase',
92 }
91 data, status_code = self.request(path, method='PUT', body=body) 93 data, status_code = self.request(path, method='PUT', body=body)
92 94
93 if status_code == 200: 95 if status_code == 200:
94 return data 96 return data
95 else: 97 else:
96 raise Exception('PR could not be merged: %d' % pull_request_number) 98 raise Exception('PR could not be merged: %d' % pull_request_number)
97 99
98 def delete_remote_branch(self, remote_branch_name): 100 def delete_remote_branch(self, remote_branch_name):
99 # TODO(jeffcarp): Unit test this method 101 # TODO(jeffcarp): Unit test this method
100 path = '/repos/w3c/web-platform-tests/git/refs/heads/%s' % remote_branch _name 102 path = '/repos/w3c/web-platform-tests/git/refs/heads/%s' % remote_branch _name
101 data, status_code = self.request(path, method='DELETE') 103 data, status_code = self.request(path, method='DELETE')
102 104
103 if status_code != 204: 105 if status_code != 204:
104 # TODO(jeffcarp): Raise more specific exception (create MergeError c lass?) 106 # TODO(jeffcarp): Raise more specific exception (create MergeError c lass?)
105 raise Exception('Received non-204 status code attempting to delete r emote branch: {}'.format(status_code)) 107 raise Exception('Received non-204 status code attempting to delete r emote branch: {}'.format(status_code))
106 108
107 return data 109 return data
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698