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