/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/propose.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:
43
43
        self.url = url
44
44
 
45
45
 
46
 
class NoMergeProposal(errors.BzrError):
47
 
 
48
 
    _fmt = "No merge proposal exists."
49
 
 
50
 
    def __init__(self):
51
 
        errors.BzrError.__init__(self)
52
 
 
53
 
 
54
46
class UnsupportedHoster(errors.BzrError):
55
47
 
56
48
    _fmt = "No supported hoster for %(branch)s."
108
100
        """Set the description of the merge proposal."""
109
101
        raise NotImplementedError(self.set_description)
110
102
 
 
103
    def get_source_branch_url(self):
 
104
        """Return the source branch."""
 
105
        raise NotImplementedError(self.get_source_branch_url)
 
106
 
 
107
    def get_target_branch_url(self):
 
108
        """Return the target branch."""
 
109
        raise NotImplementedError(self.get_target_branch_url)
 
110
 
111
111
    def close(self):
112
112
        """Close the merge proposal (without merging it)."""
113
113
        raise NotImplementedError(self.close)
192
192
        """
193
193
        raise NotImplementedError(self.get_proposer)
194
194
 
195
 
    def get_proposal(self, source_branch, target_branch):
 
195
    def iter_proposals(self, source_branch, target_branch, status='open'):
196
196
        """Get a merge proposal for a specified branch tuple.
197
197
 
198
198
        :param source_branch: Source branch
199
199
        :param target_branch: Target branch
200
 
        :raise NoMergeProposal: if no merge proposal can be found
201
 
        :return: A MergeProposal object
 
200
        :param status: Status of proposals to iterate over
 
201
        :return: Iterate over MergeProposal object
202
202
        """
203
 
        raise NotImplementedError(self.get_proposal)
 
203
        raise NotImplementedError(self.iter_proposals)
204
204
 
205
205
    def hosts(self, branch):
206
206
        """Return true if this hoster hosts given branch."""
212
212
        raise NotImplementedError(cls.probe)
213
213
 
214
214
    # TODO(jelmer): Some way of cleaning up old branch proposals/branches
215
 
    # TODO(jelmer): Some way of checking up on outstanding merge proposals
 
215
 
 
216
    def iter_my_proposals(self, status='open'):
 
217
        """Iterate over the proposals created by the currently logged in user.
 
218
 
 
219
        :param status: Only yield proposals with this status
 
220
            (one of: 'open', 'closed', 'merged', 'all')
 
221
        :return: Iterator over MergeProposal objects
 
222
        """
 
223
        raise NotImplementedError(self.iter_my_proposals)
 
224
 
 
225
    @classmethod
 
226
    def iter_instances(cls):
 
227
        """Iterate instances.
 
228
 
 
229
        :return: Hoster instances
 
230
        """
 
231
        raise NotImplementedError(cls.iter_instances)
216
232
 
217
233
 
218
234
def get_hoster(branch, possible_hosters=None):