/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« 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-05-06 03:06:18 UTC
  • mfrom: (7500.1.2 trunk-merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200506030618-131sjbc876q7on66
Merge the 3.1 branch.

Merged from https://code.launchpad.net/~jelmer/brz/trunk-merge-3.1/+merge/383481

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Launchpad plugin commands."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
from ... import (
22
20
    branch as _mod_branch,
23
21
    controldir,
35
33
    Option,
36
34
    ListOption,
37
35
    )
38
 
from ...sixish import (
39
 
    text_type,
40
 
    )
41
36
 
42
37
 
43
38
class cmd_launchpad_open(Command):
167
162
                old_username)
168
163
 
169
164
 
170
 
class cmd_lp_propose_merge(Command):
171
 
    __doc__ = """Propose merging a branch on Launchpad.
172
 
 
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.
175
 
 
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.
179
 
 
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:
184
 
 
185
 
      brz lp-propose-merge --review jrandom --review review-team=qa
186
 
 
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.
189
 
    """
190
 
 
191
 
    hidden = True
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.'),
196
 
                     Option('approve',
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.')]
202
 
 
203
 
    takes_args = ['submit_branch?']
204
 
 
205
 
    aliases = ['lp-submit', 'lp-propose']
206
 
 
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(
211
 
            '.')
212
 
        if review is None:
213
 
            reviews = None
214
 
        else:
215
 
            reviews = []
216
 
            for review in review:
217
 
                if '=' in review:
218
 
                    reviews.append(review.split('=', 2))
219
 
                else:
220
 
                    reviews.append((review, ''))
221
 
            if submit_branch is None:
222
 
                submit_branch = branch.get_submit_branch()
223
 
        if submit_branch is None:
224
 
            target = None
225
 
        else:
226
 
            target = _mod_branch.Branch.open(submit_branch)
227
 
        proposer = lp_propose.Proposer(tree, branch, target, message,
228
 
                                       reviews, staging, approve=approve,
229
 
                                       fixes=fixes)
230
 
        proposer.check_proposal()
231
 
        proposer.create_proposal()
232
 
 
233
 
 
234
165
class cmd_lp_find_proposal(Command):
235
166
 
236
167
    __doc__ = """Find the proposal to merge this revision.