Merge lp:~jelmer/brz/merge-3.2 into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/merge-3.2
Merge into: lp:brz
Diff against target: 297 lines (+38/-28)
8 files modified
.github/workflows/pythonpackage.yml (+1/-1)
breezy/controldir.py (+2/-2)
breezy/errors.py (+4/-3)
breezy/git/__init__.py (+2/-1)
breezy/plugins/github/hoster.py (+18/-14)
breezy/plugins/gitlab/hoster.py (+2/-1)
breezy/transport/http/response.py (+2/-1)
breezy/transport/http/urllib.py (+7/-5)
To merge this branch: bzr merge lp:~jelmer/brz/merge-3.2
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+409076@code.launchpad.net

Commit message

Merge lp:brz/3.2.

Description of the change

Merge lp:brz/3.2.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.github/workflows/pythonpackage.yml'
2--- .github/workflows/pythonpackage.yml 2020-11-19 01:58:47 +0000
3+++ .github/workflows/pythonpackage.yml 2021-09-23 15:16:28 +0000
4@@ -33,7 +33,7 @@
5 run: |
6 python -m pip install --upgrade pip
7 pip install -U pip setuptools
8- pip install -U pip coverage codecov flake8 testtools paramiko fastimport configobj cython testscenarios six docutils $TEST_REQUIRE sphinx sphinx_epytext launchpadlib patiencediff pyinotify git+https://github.com/dulwich/dulwich
9+ pip install -U pip coverage codecov flake8 testtools paramiko fastbencode fastimport configobj cython testscenarios six docutils $TEST_REQUIRE sphinx sphinx_epytext launchpadlib patiencediff pyinotify git+https://github.com/dulwich/dulwich
10 - name: Build docs
11 run: |
12 make docs PYTHON=python
13
14=== removed file 'README_BDIST_RPM'
15=== modified file 'breezy/controldir.py'
16--- breezy/controldir.py 2021-08-29 20:05:31 +0000
17+++ breezy/controldir.py 2021-09-23 15:16:28 +0000
18@@ -773,7 +773,7 @@
19 return klass.open_containing_from_transport(transport)
20
21 @classmethod
22- def open_containing_from_transport(klass, a_transport):
23+ def open_containing_from_transport(klass, a_transport, probers=None):
24 """Open an existing branch which contains a_transport.base.
25
26 This probes for a branch at a_transport, and searches upwards from there.
27@@ -791,7 +791,7 @@
28 url = a_transport.base
29 while True:
30 try:
31- result = klass.open_from_transport(a_transport)
32+ result = klass.open_from_transport(a_transport, probers=probers)
33 return result, urlutils.unescape(a_transport.relpath(url))
34 except errors.NotBranchError:
35 pass
36
37=== modified file 'breezy/errors.py'
38--- breezy/errors.py 2020-08-10 15:00:17 +0000
39+++ breezy/errors.py 2021-09-23 15:16:28 +0000
40@@ -1269,7 +1269,7 @@
41
42 _fmt = "Invalid http response for %(path)s: %(msg)s%(orig_error)s"
43
44- def __init__(self, path, msg, orig_error=None):
45+ def __init__(self, path, msg, orig_error=None, headers=None):
46 self.path = path
47 if orig_error is None:
48 orig_error = ''
49@@ -1277,6 +1277,7 @@
50 # This is reached for obscure and unusual errors so we want to
51 # preserve as much info as possible to ease debug.
52 orig_error = ': %r' % (orig_error,)
53+ self.headers = headers
54 TransportError.__init__(self, msg, orig_error=orig_error)
55
56
57@@ -1284,7 +1285,7 @@
58
59 _fmt = "Unexpected HTTP status %(code)d for %(path)s: %(extra)s"
60
61- def __init__(self, path, code, extra=None):
62+ def __init__(self, path, code, extra=None, headers=None):
63 self.path = path
64 self.code = code
65 self.extra = extra or ''
66@@ -1292,7 +1293,7 @@
67 if extra is not None:
68 full_msg += ': ' + extra
69 InvalidHttpResponse.__init__(
70- self, path, full_msg)
71+ self, path, full_msg, headers=headers)
72
73
74 class BadHttpRequest(UnexpectedHttpStatus):
75
76=== modified file 'breezy/git/__init__.py'
77--- breezy/git/__init__.py 2020-11-16 22:17:09 +0000
78+++ breezy/git/__init__.py 2021-09-23 15:16:28 +0000
79@@ -185,7 +185,8 @@
80 # hgweb :(
81 raise brz_errors.NotBranchError(transport.base)
82 elif resp.status != 200:
83- raise brz_errors.UnexpectedHttpStatus(url, resp.status)
84+ raise brz_errors.UnexpectedHttpStatus(
85+ url, resp.status, headers=resp.getheaders())
86
87 ct = resp.getheader("Content-Type")
88 if ct and ct.startswith("application/x-git"):
89
90=== modified file 'breezy/plugins/github/hoster.py'
91--- breezy/plugins/github/hoster.py 2021-05-02 15:07:21 +0000
92+++ breezy/plugins/github/hoster.py 2021-09-23 15:16:28 +0000
93@@ -168,7 +168,8 @@
94 if response.status == 422:
95 raise ValidationFailed(json.loads(response.text))
96 if response.status != 200:
97- raise UnexpectedHttpStatus(self._pr['url'], response.status)
98+ raise UnexpectedHttpStatus(
99+ self._pr['url'], response.status, headers=response.getheaders())
100 self._pr = json.loads(response.text)
101
102 def set_description(self, description):
103@@ -205,7 +206,8 @@
104 if response.status == 422:
105 raise ValidationFailed(json.loads(response.text))
106 if response.status != 200:
107- raise UnexpectedHttpStatus(self._pr['url'], response.status)
108+ raise UnexpectedHttpStatus(
109+ self._pr['url'], response.status, headers=response.getheaders())
110
111 def get_merged_by(self):
112 merged_by = self._pr.get('merged_by')
113@@ -228,7 +230,7 @@
114 raise ValidationFailed(json.loads(response.text))
115 if response.status != 201:
116 raise UnexpectedHttpStatus(
117- self._pr['comments_url'], response.status)
118+ self._pr['comments_url'], response.status, headers=response.getheaders())
119 json.loads(response.text)
120
121
122@@ -295,7 +297,8 @@
123 raise NoSuchProject(path)
124 if response.status == 200:
125 return json.loads(response.text)
126- raise UnexpectedHttpStatus(path, response.status)
127+ raise UnexpectedHttpStatus(
128+ path, response.status, headers=response.getheaders())
129
130 def _get_repo_pulls(self, path, head=None, state=None):
131 path = path + '?'
132@@ -311,7 +314,7 @@
133 raise NoSuchProject(path)
134 if response.status == 200:
135 return json.loads(response.text)
136- raise UnexpectedHttpStatus(path, response.status)
137+ raise UnexpectedHttpStatus(path, response.status, headers=response.getheaders())
138
139 def _create_pull(self, path, title, head, base, body=None, labels=None,
140 assignee=None, draft=False, maintainer_can_modify=False):
141@@ -336,14 +339,14 @@
142 if response.status == 422:
143 raise ValidationFailed(json.loads(response.text))
144 if response.status != 201:
145- raise UnexpectedHttpStatus(path, response.status)
146+ raise UnexpectedHttpStatus(path, response.status, headers=response.getheaders())
147 return json.loads(response.text)
148
149 def _get_user_by_email(self, email):
150 path = 'search/users?q=%s+in:email' % email
151 response = self._api_request('GET', path)
152 if response.status != 200:
153- raise UnexpectedHttpStatus(path, response.status)
154+ raise UnexpectedHttpStatus(path, response.status, headers=response.getheaders())
155 ret = json.loads(response.text)
156 if ret['total_count'] == 0:
157 raise KeyError('no user with email %s' % email)
158@@ -358,14 +361,14 @@
159 path = 'user'
160 response = self._api_request('GET', path)
161 if response.status != 200:
162- raise UnexpectedHttpStatus(path, response.status)
163+ raise UnexpectedHttpStatus(path, response.status, headers=response.getheaders())
164 return json.loads(response.text)
165
166 def _get_organization(self, name):
167 path = 'orgs/%s' % name
168 response = self._api_request('GET', path)
169 if response.status != 200:
170- raise UnexpectedHttpStatus(path, response.status)
171+ raise UnexpectedHttpStatus(path, response.status, headers=response.getheaders())
172 return json.loads(response.text)
173
174 def _list_paged(self, path, parameters=None, per_page=None):
175@@ -384,7 +387,7 @@
176 ';'.join(['%s=%s' % (k, urlutils.quote(v))
177 for (k, v) in parameters.items()]))
178 if response.status != 200:
179- raise UnexpectedHttpStatus(path, response.status)
180+ raise UnexpectedHttpStatus(path, response.status, headers=response.getheaders())
181 data = json.loads(response.text)
182 for entry in data['items']:
183 i += 1
184@@ -402,7 +405,7 @@
185 path += '?organization=%s' % owner
186 response = self._api_request('POST', path)
187 if response.status != 202:
188- raise UnexpectedHttpStatus(path, response.status)
189+ raise UnexpectedHttpStatus(path, response.status, headers=response.getheaders())
190 return json.loads(response.text)
191
192 @property
193@@ -558,7 +561,7 @@
194 url = issue['pull_request']['url']
195 response = self._api_request('GET', url)
196 if response.status != 200:
197- raise UnexpectedHttpStatus(url, response.status)
198+ raise UnexpectedHttpStatus(url, response.status, headers=response.getheaders())
199 yield GitHubMergeProposal(self, json.loads(response.text))
200
201 def get_proposal_by_url(self, url):
202@@ -571,7 +574,8 @@
203 path = '/user/repos'
204 response = self._api_request('GET', path)
205 if response.status != 200:
206- raise UnexpectedHttpStatus(self.transport.user_url, response.status)
207+ raise UnexpectedHttpStatus(
208+ self.transport.user_url, response.status, headers=response.getheaders())
209 for project in json.loads(response.text):
210 if not project['fork']:
211 continue
212@@ -586,7 +590,7 @@
213 return
214 if response.status == 200:
215 return json.loads(response.text)
216- raise UnexpectedHttpStatus(path, response.status)
217+ raise UnexpectedHttpStatus(path, response.status, headers=response.getheaders())
218
219 def get_current_user(self):
220 if self._token is not None:
221
222=== modified file 'breezy/plugins/gitlab/hoster.py'
223--- breezy/plugins/gitlab/hoster.py 2021-05-02 15:07:21 +0000
224+++ breezy/plugins/gitlab/hoster.py 2021-09-23 15:16:28 +0000
225@@ -232,7 +232,8 @@
226
227 def _unexpected_status(path, response):
228 raise errors.UnexpectedHttpStatus(
229- path, response.status, response.data.decode('utf-8', 'replace'))
230+ path, response.status, response.data.decode('utf-8', 'replace'),
231+ headers=response.getheaders())
232
233
234 class GitLabMergeProposal(MergeProposal):
235
236=== modified file 'breezy/transport/http/response.py'
237--- breezy/transport/http/response.py 2020-07-18 23:14:00 +0000
238+++ breezy/transport/http/response.py 2021-09-23 15:16:28 +0000
239@@ -218,7 +218,8 @@
240 if content_range is None:
241 raise errors.InvalidHttpResponse(
242 self._path,
243- 'Content-Range header missing in a multi-part response')
244+ 'Content-Range header missing in a multi-part response',
245+ headers=self._headers)
246 self.set_range_from_header(content_range)
247
248 def set_range_from_header(self, content_range):
249
250=== modified file 'breezy/transport/http/urllib.py'
251--- breezy/transport/http/urllib.py 2021-05-02 15:07:21 +0000
252+++ breezy/transport/http/urllib.py 2021-09-23 15:16:28 +0000
253@@ -1732,7 +1732,8 @@
254 else:
255 raise errors.UnexpectedHttpStatus(
256 req.get_full_url(), code,
257- 'Unable to handle http code: %s' % msg)
258+ 'Unable to handle http code: %s' % msg,
259+ headers=hdrs)
260
261
262 class Opener(object):
263@@ -1983,7 +1984,7 @@
264 else:
265 raise errors.BadHttpRequest(abspath, response.reason)
266 elif response.status not in (200, 206):
267- raise errors.UnexpectedHttpStatus(abspath, response.status)
268+ raise errors.UnexpectedHttpStatus(abspath, response.status, headers=response.getheaders())
269
270 data = handle_response(
271 abspath, response.status, response.getheader, response)
272@@ -2214,7 +2215,7 @@
273 'POST', abspath, body=body_bytes,
274 headers={'Content-Type': 'application/octet-stream'})
275 if response.status not in (200, 403):
276- raise errors.UnexpectedHttpStatus(abspath, response.status)
277+ raise errors.UnexpectedHttpStatus(abspath, response.status, headers=response.getheaders())
278 code = response.status
279 data = handle_response(
280 abspath, code, response.getheader, response)
281@@ -2228,7 +2229,7 @@
282 abspath = self._remote_path(relpath)
283 response = self.request('HEAD', abspath)
284 if response.status not in (200, 404):
285- raise errors.UnexpectedHttpStatus(abspath, response.status)
286+ raise errors.UnexpectedHttpStatus(abspath, response.status, headers=response.getheaders())
287
288 return response
289
290@@ -2457,7 +2458,8 @@
291 if resp.status in (403, 405):
292 raise errors.InvalidHttpResponse(
293 abspath,
294- "OPTIONS not supported or forbidden for remote URL")
295+ "OPTIONS not supported or forbidden for remote URL",
296+ headers=resp.getheaders())
297 return resp.getheaders()
298
299

Subscribers

People subscribed via source and target branches