Merge lp:~jelmer/brz/proposal-owner into lp:brz/3.1

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/proposal-owner
Merge into: lp:brz/3.1
Diff against target: 27 lines (+6/-3)
1 file modified
breezy/plugins/gitlab/hoster.py (+6/-3)
To merge this branch: bzr merge lp:~jelmer/brz/proposal-owner
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+387890@code.launchpad.net

Commit message

Fix support for owner in GitLab proposals.

Description of the change

Fix support for owner in GitLab proposals.

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 'breezy/plugins/gitlab/hoster.py'
2--- breezy/plugins/gitlab/hoster.py 2020-07-20 03:21:15 +0000
3+++ breezy/plugins/gitlab/hoster.py 2020-07-22 22:28:18 +0000
4@@ -369,9 +369,12 @@
5 return json.loads(response.data)
6 raise errors.UnexpectedHttpStatus(path, response.status)
7
8- def _fork_project(self, project_name, timeout=50, interval=5):
9+ def _fork_project(self, project_name, timeout=50, interval=5, owner=None):
10 path = 'projects/%s/fork' % urlutils.quote(str(project_name), '')
11- response = self._api_request('POST', path)
12+ fields = {}
13+ if owner is not None:
14+ fields['namespace'] = owner
15+ response = self._api_request('POST', path, fields=fields)
16 if response.status == 404:
17 raise ForkingDisabled(project_name)
18 if response.status == 409:
19@@ -500,7 +503,7 @@
20 try:
21 target_project = self._get_project('%s/%s' % (owner, project))
22 except NoSuchProject:
23- target_project = self._fork_project(base_project)
24+ target_project = self._fork_project(base_project, owner=owner)
25 remote_repo_url = git_url_to_bzr_url(target_project['ssh_url_to_repo'])
26 remote_dir = controldir.ControlDir.open(remote_repo_url)
27 try:

Subscribers

People subscribed via source and target branches