277
285
register_command(cmd_launchpad_mirror)
288
class cmd_lp_propose_merge(Command):
289
__doc__ = """Propose merging a branch on Launchpad.
291
This will open your usual editor to provide the initial comment. When it
292
has created the proposal, it will open it in your default web browser.
294
The branch will be proposed to merge into SUBMIT_BRANCH. If SUBMIT_BRANCH
295
is not supplied, the remembered submit branch will be used. If no submit
296
branch is remembered, the development focus will be used.
298
By default, the SUBMIT_BRANCH's review team will be requested to review
299
the merge proposal. This can be overriden by specifying --review (-R).
300
The parameter the launchpad account name of the desired reviewer. This
301
may optionally be followed by '=' and the review type. For example:
303
bzr lp-propose-merge --review jrandom --review review-team=qa
305
This will propose a merge, request "jrandom" to perform a review of
306
unspecified type, and request "review-team" to perform a "qa" review.
309
takes_options = [Option('staging',
310
help='Propose the merge on staging.'),
311
Option('message', short_name='m', type=unicode,
312
help='Commit message.'),
314
help='Mark the proposal as approved immediately.'),
315
ListOption('review', short_name='R', type=unicode,
316
help='Requested reviewer and optional type.')]
318
takes_args = ['submit_branch?']
320
aliases = ['lp-submit', 'lp-propose']
322
def run(self, submit_branch=None, review=None, staging=False,
323
message=None, approve=False):
324
from bzrlib.plugins.launchpad import lp_propose
325
tree, branch, relpath = bzrdir.BzrDir.open_containing_tree_or_branch(
331
for review in review:
333
reviews.append(review.split('=', 2))
335
reviews.append((review, ''))
336
if submit_branch is None:
337
submit_branch = branch.get_submit_branch()
338
if submit_branch is None:
341
target = _mod_branch.Branch.open(submit_branch)
342
proposer = lp_propose.Proposer(tree, branch, target, message,
343
reviews, staging, approve=approve)
344
proposer.check_proposal()
345
proposer.create_proposal()
348
register_command(cmd_lp_propose_merge)
280
351
def _register_directory():
281
352
directories.register_lazy('lp:', 'bzrlib.plugins.launchpad.lp_directory',
282
353
'LaunchpadDirectory',