/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: Jelmer Vernooij
  • Date: 2020-07-28 02:11:05 UTC
  • mfrom: (7490.40.78 work)
  • mto: This revision was merged to the branch mainline in revision 7520.
  • Revision ID: jelmer@jelmer.uk-20200728021105-fzq7g6f8bl1g0aet
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
            closed='Closed merge proposals')]
268
268
 
269
269
    def run(self, status='open', verbose=False):
270
 
        for name, hoster_cls in _mod_propose.hosters.items():
271
 
            for instance in hoster_cls.iter_instances():
272
 
                for mp in instance.iter_my_proposals(status=status):
273
 
                    self.outf.write('%s\n' % mp.url)
274
 
                    if verbose:
275
 
                        self.outf.write(
276
 
                            '(Merging %s into %s)\n' %
277
 
                            (mp.get_source_branch_url(),
278
 
                             mp.get_target_branch_url()))
279
 
                        description = mp.get_description()
280
 
                        if description:
281
 
                            self.outf.writelines(
282
 
                                ['\t%s\n' % l
283
 
                                 for l in description.splitlines()])
284
 
                        self.outf.write('\n')
 
270
        for instance in _mod_propose.iter_hoster_instances():
 
271
            for mp in instance.iter_my_proposals(status=status):
 
272
                self.outf.write('%s\n' % mp.url)
 
273
                if verbose:
 
274
                    self.outf.write(
 
275
                        '(Merging %s into %s)\n' %
 
276
                        (mp.get_source_branch_url(),
 
277
                         mp.get_target_branch_url()))
 
278
                    description = mp.get_description()
 
279
                    if description:
 
280
                        self.outf.writelines(
 
281
                            ['\t%s\n' % l
 
282
                             for l in description.splitlines()])
 
283
                    self.outf.write('\n')
285
284
 
286
285
 
287
286
class cmd_land_merge_proposal(Command):
294
293
    def run(self, url, message=None):
295
294
        proposal = _mod_propose.get_proposal_by_url(url)
296
295
        proposal.merge(commit_message=message)
 
296
 
 
297
 
 
298
class cmd_hosters(Command):
 
299
    __doc__ = """List all known hosting sites and user details."""
 
300
 
 
301
    hidden = True
 
302
 
 
303
    def run(self):
 
304
        for instance in _mod_propose.iter_hoster_instances():
 
305
            current_user = instance.get_current_user()
 
306
            self.outf.write(
 
307
                gettext('%s (%s) - user: %s (%s)\n') % (
 
308
                    instance.name, instance.base_url,
 
309
                    current_user, instance.get_user_url(current_user)))