Merge lp:~jelmer/brz/trunk-merge-3.1 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/trunk-merge-3.1
Merge into: lp:brz
Diff against target: 168 lines (+23/-12)
6 files modified
breezy/git/remote.py (+3/-1)
breezy/plugins/propose/cmds.py (+5/-2)
breezy/plugins/propose/github.py (+7/-4)
breezy/plugins/propose/gitlabs.py (+3/-3)
breezy/plugins/propose/launchpad.py (+1/-1)
breezy/propose.py (+4/-1)
To merge this branch: bzr merge lp:~jelmer/brz/trunk-merge-3.1
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+380392@code.launchpad.net

Commit message

Merge the lp:brz/3.1 branch.

Description of the change

Merge the lp:brz/3.1 branch.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/git/remote.py'
2--- breezy/git/remote.py 2020-02-18 01:57:45 +0000
3+++ breezy/git/remote.py 2020-03-07 14:57:03 +0000
4@@ -545,7 +545,7 @@
5
6 def push_branch(self, source, revision_id=None, overwrite=False,
7 remember=False, create_prefix=False, lossy=False,
8- name=None):
9+ name=None, tag_selector=None):
10 """Push the source branch into this ControlDir."""
11 if revision_id is None:
12 # No revision supplied by the user, default to the branch
13@@ -590,6 +590,8 @@
14 ret[actual_refname] = new_sha
15 if fetch_tags:
16 for tagname, revid in source.tags.get_tag_dict().items():
17+ if tag_selector and not tag_selector(tagname):
18+ continue
19 if lossy:
20 try:
21 new_sha = source_store._lookup_revision_sha1(revid)
22
23=== modified file 'breezy/plugins/propose/cmds.py'
24--- breezy/plugins/propose/cmds.py 2020-02-18 01:57:45 +0000
25+++ breezy/plugins/propose/cmds.py 2020-03-07 14:57:03 +0000
26@@ -149,6 +149,8 @@
27 help='Labels to apply.'),
28 Option('no-allow-lossy',
29 help='Allow fallback to lossy push, if necessary.'),
30+ Option('allow-collaboration',
31+ help='Allow collaboration from target branch maintainer(s)'),
32 ]
33 takes_args = ['submit_branch?']
34
35@@ -156,7 +158,8 @@
36
37 def run(self, submit_branch=None, directory='.', hoster=None,
38 reviewers=None, name=None, no_allow_lossy=False, description=None,
39- labels=None, prerequisite=None, commit_message=None, wip=False):
40+ labels=None, prerequisite=None, commit_message=None, wip=False,
41+ allow_collaboration=False):
42 tree, branch, relpath = (
43 controldir.ControlDir.open_containing_tree_or_branch(directory))
44 if submit_branch is None:
45@@ -196,7 +199,7 @@
46 description=description, reviewers=reviewers,
47 prerequisite_branch=prerequisite_branch, labels=labels,
48 commit_message=commit_message,
49- work_in_progress=wip)
50+ work_in_progress=wip, allow_collaboration=allow_collaboration)
51 except _mod_propose.MergeProposalExists as e:
52 note(gettext('There is already a branch merge proposal: %s'), e.url)
53 else:
54
55=== modified file 'breezy/plugins/propose/github.py'
56--- breezy/plugins/propose/github.py 2020-02-21 03:58:42 +0000
57+++ breezy/plugins/propose/github.py 2020-03-07 14:57:03 +0000
58@@ -275,12 +275,14 @@
59 return json.loads(response.text)
60 raise InvalidHttpResponse(path, response.text)
61
62- def _create_pull(self, path, title, head, base, body=None, labels=None, assignee=None, draft=False):
63+ def _create_pull(self, path, title, head, base, body=None, labels=None,
64+ assignee=None, draft=False, maintainer_can_modify=False):
65 data = {
66 'title': title,
67 'head': head,
68 'base': base,
69 'draft': draft,
70+ 'maintainer_can_modify': maintainer_can_modify,
71 }
72 if labels is not None:
73 data['labels'] = labels
74@@ -551,7 +553,7 @@
75
76 def create_proposal(self, description, reviewers=None, labels=None,
77 prerequisite_branch=None, commit_message=None,
78- work_in_progress=False):
79+ work_in_progress=False, allow_collaboration=False):
80 """Perform the submission."""
81 if prerequisite_branch is not None:
82 raise PrerequisiteBranchUnsupported(self)
83@@ -561,7 +563,6 @@
84 self.target_repo_name = self.target_repo_name[:-4]
85 # TODO(jelmer): Allow setting title explicitly?
86 title = determine_title(description)
87- # TODO(jelmer): Set maintainers_can_modify?
88 target_repo = self.gh._get_repo(
89 self.target_owner, self.target_repo_name)
90 assignees = []
91@@ -582,7 +583,9 @@
92 head="%s:%s" % (self.source_owner, self.source_branch_name),
93 base=self.target_branch_name,
94 labels=labels, assignee=assignees,
95- draft=(not work_in_progress))
96+ draft=work_in_progress,
97+ maintainer_can_modify=allow_collaboration,
98+ )
99 except ValidationFailed:
100 raise MergeProposalExists(self.source_branch.user_url)
101 return GitHubMergeProposal(self.gh, pull_request)
102
103=== modified file 'breezy/plugins/propose/gitlabs.py'
104--- breezy/plugins/propose/gitlabs.py 2020-02-21 03:58:42 +0000
105+++ breezy/plugins/propose/gitlabs.py 2020-03-07 14:57:03 +0000
106@@ -583,7 +583,7 @@
107
108 def create_proposal(self, description, reviewers=None, labels=None,
109 prerequisite_branch=None, commit_message=None,
110- work_in_progress=False):
111+ work_in_progress=False, allow_collaboration=False):
112 """Perform the submission."""
113 # https://docs.gitlab.com/ee/api/merge_requests.html#create-mr
114 if prerequisite_branch is not None:
115@@ -595,7 +595,6 @@
116 title = determine_title(description)
117 if work_in_progress:
118 title = 'WIP: %s' % title
119- # TODO(jelmer): Allow setting allow_collaboration field
120 # TODO(jelmer): Allow setting milestone field
121 # TODO(jelmer): Allow setting squash field
122 kwargs = {
123@@ -604,7 +603,8 @@
124 'target_project_id': target_project['id'],
125 'source_branch_name': self.source_branch_name,
126 'target_branch_name': self.target_branch_name,
127- 'description': description}
128+ 'description': description,
129+ 'allow_collaboration': allow_collaboration}
130 if labels:
131 kwargs['labels'] = ','.join(labels)
132 if reviewers:
133
134=== modified file 'breezy/plugins/propose/launchpad.py'
135--- breezy/plugins/propose/launchpad.py 2020-02-21 03:58:42 +0000
136+++ breezy/plugins/propose/launchpad.py 2020-03-07 14:57:03 +0000
137@@ -548,7 +548,7 @@
138
139 def create_proposal(self, description, reviewers=None, labels=None,
140 prerequisite_branch=None, commit_message=None,
141- work_in_progress=False):
142+ work_in_progress=False, allow_collaboration=False):
143 """Perform the submission."""
144 if labels:
145 raise LabelsUnsupported(self)
146
147=== modified file 'breezy/propose.py'
148--- breezy/propose.py 2020-02-21 03:58:42 +0000
149+++ breezy/propose.py 2020-03-07 14:57:03 +0000
150@@ -200,7 +200,7 @@
151
152 def create_proposal(self, description, reviewers=None, labels=None,
153 prerequisite_branch=None, commit_message=None,
154- work_in_progress=False):
155+ work_in_progress=False, allow_collaboration=False):
156 """Create a proposal to merge a branch for merging.
157
158 :param description: Description for the merge proposal
159@@ -210,6 +210,9 @@
160 :param commit_message: Optional commit message
161 :param work_in_progress:
162 Whether this merge proposal is still a work-in-progress
163+ :param allow_collaboration:
164+ Whether to allow changes to the branch from the target branch
165+ maintainer(s)
166 :return: A `MergeProposal` object
167 """
168 raise NotImplementedError(self.create_proposal)

Subscribers

People subscribed via source and target branches