/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/propose/cmds.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-01-08 22:04:13 UTC
  • mfrom: (7233.3.7 my-proposals)
  • Revision ID: breezy.the.bot@gmail.com-20190108220413-jnk79i8o4wk0h52j
Add 'bzr my-proposals' command.

Merged from https://code.launchpad.net/~jelmer/brz/my-proposals/+merge/361363

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
        else:
224
224
            target = _mod_branch.Branch.open(submit_branch)
225
225
        hoster = _mod_propose.get_hoster(branch)
226
 
        mp = hoster.get_proposal(branch, target)
227
 
        self.outf.write(gettext('Merge proposal: %s\n') % mp.url)
 
226
        for mp in hoster.iter_proposals(branch, target):
 
227
            self.outf.write(gettext('Merge proposal: %s\n') % mp.url)
228
228
 
229
229
 
230
230
class cmd_github_login(Command):
300
300
            gl = Gitlab(url=url, private_token=private_token)
301
301
            gl.auth()
302
302
        store_gitlab_token(name=name, url=url, private_token=private_token)
 
303
 
 
304
 
 
305
class cmd_my_merge_proposals(Command):
 
306
    __doc__ = """List all merge proposals owned by the logged-in user.
 
307
 
 
308
    """
 
309
 
 
310
    hidden = True
 
311
 
 
312
    takes_options = [
 
313
        RegistryOption.from_kwargs(
 
314
            'status',
 
315
            title='Proposal Status',
 
316
            help='Only include proposals with specified status.',
 
317
            value_switches=True,
 
318
            enum_switch=True,
 
319
            all='All merge proposals',
 
320
            open='Open merge proposals',
 
321
            merged='Merged merge proposals',
 
322
            closed='Closed merge proposals')]
 
323
 
 
324
    def run(self, status='open'):
 
325
        from .propose import hosters
 
326
        for name, hoster_cls in hosters.items():
 
327
            for instance in hoster_cls.iter_instances():
 
328
                for mp in instance.iter_my_proposals(status=status):
 
329
                    self.outf.write('%s\n' % mp.url)