Merge lp:~jelmer/brz/propose-close into lp:brz

Proposed by Jelmer Vernooij on 2019-01-31
Status: Merged
Approved by: Jelmer Vernooij on 2019-02-02
Approved revision: 7261
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/propose-close
Merge into: lp:brz
Diff against target: 42 lines (+10/-0)
3 files modified
breezy/plugins/propose/github.py (+3/-0)
breezy/plugins/propose/gitlabs.py (+4/-0)
breezy/plugins/propose/launchpad.py (+3/-0)
To merge this branch: bzr merge lp:~jelmer/brz/propose-close
Reviewer Review Type Date Requested Status
Martin Packman 2019-01-31 Approve on 2019-02-02
Review via email: mp+362564@code.launchpad.net

Description of the change

Implement .close on merge proposals for {launchpad,github,gitlab}.

To post a comment you must log in.
Martin Packman (gz) wrote :

Thanks! (Should really be tests for these.)

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-01-04 00:40:55 +0000
3+++ breezy/plugins/propose/github.py 2019-01-31 23:31:35 +0000
4@@ -122,6 +122,9 @@
5 def is_merged(self):
6 return self._pr.merged
7
8+ def close(self):
9+ self._pr.edit(state='closed')
10+
11
12 def parse_github_url(branch):
13 url = urlutils.split_segment_parameters(branch.user_url)[0]
14
15=== modified file 'breezy/plugins/propose/gitlabs.py'
16--- breezy/plugins/propose/gitlabs.py 2019-01-04 00:40:55 +0000
17+++ breezy/plugins/propose/gitlabs.py 2019-01-31 23:31:35 +0000
18@@ -163,6 +163,10 @@
19 def is_merged(self):
20 return (self._mr.state == 'merged')
21
22+ def close(self):
23+ self._mr.state_event = 'close'
24+ self._mr.save()
25+
26
27 def gitlab_url_to_bzr_url(url, name):
28 if not PY3:
29
30=== modified file 'breezy/plugins/propose/launchpad.py'
31--- breezy/plugins/propose/launchpad.py 2019-01-28 21:02:24 +0000
32+++ breezy/plugins/propose/launchpad.py 2019-01-31 23:31:35 +0000
33@@ -141,6 +141,9 @@
34 def set_description(self, description):
35 self._mp.description = description
36
37+ def close(self):
38+ self._mp.setStatus(status='Rejected')
39+
40
41 class Launchpad(Hoster):
42 """The Launchpad hosting service."""

Subscribers

People subscribed via source and target branches