~jelmer/brz/byov-trunk

« back to all changes in this revision

Viewing changes to breezy/plugins/launchpad/cmds.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-19 03:16:24 UTC
  • mfrom: (7492.2.1 propose-more)
  • Revision ID: breezy.the.bot@gmail.com-20200219031624-994l6d0xqb8be6yh
Drop the 'brz lp-propose' command in favour of 'brz propose'.

Merged from https://code.launchpad.net/~jelmer/brz/propose-more/+merge/379264

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
                old_username)
163
163
 
164
164
 
165
 
class cmd_lp_propose_merge(Command):
166
 
    __doc__ = """Propose merging a branch on Launchpad.
167
 
 
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.
170
 
 
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.
174
 
 
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:
179
 
 
180
 
      brz lp-propose-merge --review jrandom --review review-team=qa
181
 
 
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.
184
 
    """
185
 
 
186
 
    hidden = True
187
 
    takes_options = [Option('staging',
188
 
                            help='Propose the merge on staging.'),
189
 
                     Option('message', short_name='m', type=str,
190
 
                            help='Commit message.'),
191
 
                     Option('approve',
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.')]
197
 
 
198
 
    takes_args = ['submit_branch?']
199
 
 
200
 
    aliases = ['lp-submit', 'lp-propose']
201
 
 
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(
206
 
            '.')
207
 
        if review is None:
208
 
            reviews = None
209
 
        else:
210
 
            reviews = []
211
 
            for review in review:
212
 
                if '=' in review:
213
 
                    reviews.append(review.split('=', 2))
214
 
                else:
215
 
                    reviews.append((review, ''))
216
 
            if submit_branch is None:
217
 
                submit_branch = branch.get_submit_branch()
218
 
        if submit_branch is None:
219
 
            target = None
220
 
        else:
221
 
            target = _mod_branch.Branch.open(submit_branch)
222
 
        proposer = lp_propose.Proposer(tree, branch, target, message,
223
 
                                       reviews, staging, approve=approve,
224
 
                                       fixes=fixes)
225
 
        proposer.check_proposal()
226
 
        proposer.create_proposal()
227
 
 
228
 
 
229
165
class cmd_lp_find_proposal(Command):
230
166
 
231
167
    __doc__ = """Find the proposal to merge this revision.