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

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

Issue 2657523005: WPT Export: trim lines from branch list, stage changes before committing (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 | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/local_wpt.py ('k') | 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 if status_code == 200: 93 if status_code == 200:
94 return data 94 return data
95 else: 95 else:
96 raise Exception('PR could not be merged: %d' % pull_request_number) 96 raise Exception('PR could not be merged: %d' % pull_request_number)
97 97
98 def delete_remote_branch(self, remote_branch_name): 98 def delete_remote_branch(self, remote_branch_name):
99 path = '/repos/w3c/web-platform-tests/git/refs/heads/%s' % remote_branch _name 99 path = '/repos/w3c/web-platform-tests/git/refs/heads/%s' % remote_branch _name
100 data, status_code = self.request(path, method='DELETE') 100 data, status_code = self.request(path, method='DELETE')
101 101
102 if status_code != 200: 102 if status_code != 204:
103 # TODO(jeffcarp): Raise more specific exception (create MergeError c lass?) 103 # TODO(jeffcarp): Raise more specific exception (create MergeError c lass?)
104 raise Exception('PR could not be merged') 104 raise Exception('Received non-204 status code attempting to delete r emote branch: {}'.format(status_code))
105 105
106 return data 106 return data
qyearsley 2017/01/24 18:30:56 Note, this could probably be unit-tested by making
jeffcarp 2017/01/25 19:40:00 I'll add a TODO.
OLDNEW
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/local_wpt.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698