165
class cmd_lp_propose_merge(Command):
166
__doc__ = """Propose merging a branch on Launchpad.
168
This will open your usual editor to provide the initial comment. When it
169
has created the proposal, it will open it in your default web browser.
171
The branch will be proposed to merge into SUBMIT_BRANCH. If SUBMIT_BRANCH
172
is not supplied, the remembered submit branch will be used. If no submit
173
branch is remembered, the development focus will be used.
175
By default, the SUBMIT_BRANCH's review team will be requested to review
176
the merge proposal. This can be overriden by specifying --review (-R).
177
The parameter the launchpad account name of the desired reviewer. This
178
may optionally be followed by '=' and the review type. For example:
180
brz lp-propose-merge --review jrandom --review review-team=qa
182
This will propose a merge, request "jrandom" to perform a review of
183
unspecified type, and request "review-team" to perform a "qa" review.
187
takes_options = [Option('staging',
188
help='Propose the merge on staging.'),
189
Option('message', short_name='m', type=str,
190
help='Commit message.'),
192
help=('Mark the proposal as approved immediately, '
193
'setting the approved revision to tip.')),
194
Option('fixes', 'The bug this proposal fixes.', str),
195
ListOption('review', short_name='R', type=str,
196
help='Requested reviewer and optional type.')]
198
takes_args = ['submit_branch?']
200
aliases = ['lp-submit', 'lp-propose']
202
def run(self, submit_branch=None, review=None, staging=False,
203
message=None, approve=False, fixes=None):
204
from . import lp_propose
205
tree, branch, relpath = controldir.ControlDir.open_containing_tree_or_branch(
211
for review in review:
213
reviews.append(review.split('=', 2))
215
reviews.append((review, ''))
216
if submit_branch is None:
217
submit_branch = branch.get_submit_branch()
218
if submit_branch is None:
221
target = _mod_branch.Branch.open(submit_branch)
222
proposer = lp_propose.Proposer(tree, branch, target, message,
223
reviews, staging, approve=approve,
225
proposer.check_proposal()
226
proposer.create_proposal()
229
165
class cmd_lp_find_proposal(Command):
231
167
__doc__ = """Find the proposal to merge this revision.