Merge lp:~jelmer/brz/propose-fork 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/propose-fork
Merge into: lp:brz
Diff against target: 39 lines (+5/-6)
2 files modified
breezy/plugins/propose/github.py (+1/-1)
breezy/plugins/propose/gitlabs.py (+4/-5)
To merge this branch: bzr merge lp:~jelmer/brz/propose-fork
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+373703@code.launchpad.net

Commit message

Fix forking on GitHub/GitLab.

Description of the change

Fix forking on GitHub/GitLab.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/plugins/propose/github.py'
2--- breezy/plugins/propose/github.py 2019-08-25 22:52:43 +0000
3+++ breezy/plugins/propose/github.py 2019-10-05 21:38:54 +0000
4@@ -317,7 +317,7 @@
5 if owner:
6 path += '?organization=%s' % owner
7 response = self._api_request('POST', path)
8- if response != 202:
9+ if response.status != 202:
10 raise InvalidHttpResponse(path, response.text)
11 return json.loads(response.text)
12
13
14=== modified file 'breezy/plugins/propose/gitlabs.py'
15--- breezy/plugins/propose/gitlabs.py 2019-08-25 16:10:09 +0000
16+++ breezy/plugins/propose/gitlabs.py 2019-10-05 21:38:54 +0000
17@@ -301,18 +301,17 @@
18 if response.status not in (200, 201):
19 raise errors.InvalidHttpResponse(path, response.text)
20 # The response should be valid JSON, but let's ignore it
21- json.loads(response.data)
22+ project = json.loads(response.data)
23 # Spin and wait until import_status for new project
24 # is complete.
25 deadline = time.time() + timeout
26- while True:
27- project = self._get_project(project_name)
28- if project['import_status'] in ('finished', 'none'):
29- return project
30+ while project['import_status'] not in ('finished', 'none'):
31 mutter('import status is %s', project['import_status'])
32 if time.time() > deadline:
33 raise Exception('timeout waiting for project to become available')
34 time.sleep(interval)
35+ project = self._get_project(project['path_with_namespace'])
36+ return project
37
38 def _get_logged_in_username(self):
39 return self._current_user['username']

Subscribers

People subscribed via source and target branches