/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

Support user.signingkey configuration variable in .git/config.

Merged from https://code.launchpad.net/~jelmer/brz/local-git-key/+merge/381000

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
 
19
21
from ... import (
20
22
    branch as _mod_branch,
21
23
    controldir,
33
35
    Option,
34
36
    ListOption,
35
37
    )
 
38
from ...sixish import (
 
39
    text_type,
 
40
    )
36
41
 
37
42
 
38
43
class cmd_launchpad_open(Command):
162
167
                old_username)
163
168
 
164
169
 
 
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
 
165
234
class cmd_lp_find_proposal(Command):
166
235
 
167
236
    __doc__ = """Find the proposal to merge this revision.