/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: Jelmer Vernooij
  • Date: 2019-03-04 00:16:27 UTC
  • mfrom: (7293 work)
  • mto: This revision was merged to the branch mainline in revision 7318.
  • Revision ID: jelmer@jelmer.uk-20190304001627-v6u7o6pf97tukhek
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
        trace.note(gettext('Opening %s in web browser') % web_url)
86
86
        if not dry_run:
87
87
            import webbrowser   # this import should not be lazy
88
 
                                # otherwise brz.exe lacks this module
 
88
            # otherwise brz.exe lacks this module
89
89
            webbrowser.open(web_url)
90
90
 
91
91
 
140
140
            account.set_lp_login(name)
141
141
            if verbose:
142
142
                self.outf.write(gettext("Launchpad user ID set to '%s'.\n") %
143
 
                                                                        (name,))
 
143
                                (name,))
144
144
 
145
145
 
146
146
class cmd_launchpad_logout(Command):
167
167
                old_username)
168
168
 
169
169
 
170
 
# XXX: cmd_launchpad_mirror is untested
171
 
class cmd_launchpad_mirror(Command):
172
 
    __doc__ = """Ask Launchpad to mirror a branch now."""
173
 
 
174
 
    aliases = ['lp-mirror']
175
 
    takes_args = ['location?']
176
 
 
177
 
    def run(self, location='.'):
178
 
        from . import lp_api
179
 
        from .lp_registration import LaunchpadService
180
 
        branch, _ = _mod_branch.Branch.open_containing(location)
181
 
        service = LaunchpadService()
182
 
        launchpad = lp_api.login(service)
183
 
        lp_branch = lp_api.LaunchpadBranch.from_bzr(launchpad, branch,
184
 
                create_missing=False)
185
 
        lp_branch.lp.requestMirror()
186
 
 
187
 
 
188
170
class cmd_lp_propose_merge(Command):
189
171
    __doc__ = """Propose merging a branch on Launchpad.
190
172
 
206
188
    unspecified type, and request "review-team" to perform a "qa" review.
207
189
    """
208
190
 
 
191
    hidden = True
209
192
    takes_options = [Option('staging',
210
193
                            help='Propose the merge on staging.'),
211
194
                     Option('message', short_name='m', type=text_type,
215
198
                                  'setting the approved revision to tip.')),
216
199
                     Option('fixes', 'The bug this proposal fixes.', str),
217
200
                     ListOption('review', short_name='R', type=text_type,
218
 
                            help='Requested reviewer and optional type.')]
 
201
                                help='Requested reviewer and optional type.')]
219
202
 
220
203
    takes_args = ['submit_branch?']
221
204
 
284
267
                webbrowser.open(lp_api.canonical_url(mp))
285
268
 
286
269
    def _find_proposals(self, revision_id, pb):
287
 
        from . import (lp_api, lp_registration)
 
270
        from launchpadlib import uris
 
271
        from . import lp_api
288
272
        # "devel" because branches.getMergeProposals is not part of 1.0 API.
289
 
        launchpad = lp_api.login(lp_registration.LaunchpadService(),
290
 
                                 version='devel')
 
273
        lp_base_url = uris.LPNET_SERVICE_ROOT
 
274
        launchpad = lp_api.connect_launchpad(lp_base_url, version='devel')
291
275
        pb.update(gettext('Finding proposals'))
292
276
        return list(launchpad.branches.getMergeProposals(
293
 
                    merged_revision=revision_id))
 
277
                    merged_revision=revision_id.decode('utf-8')))