/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/github.py

  • Committer: Jelmer Vernooij
  • Date: 2019-01-03 02:35:46 UTC
  • mfrom: (0.431.67 trunk)
  • mto: This revision was merged to the branch mainline in revision 7239.
  • Revision ID: jelmer@jelmer.uk-20190103023546-pryb5dotaw5ecbbt
Merge lp:brz-propose.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    MergeProposal,
26
26
    MergeProposalBuilder,
27
27
    MergeProposalExists,
28
 
    NoMergeProposal,
29
28
    PrerequisiteBranchUnsupported,
30
29
    UnsupportedHoster,
31
30
    )
216
215
    def get_proposer(self, source_branch, target_branch):
217
216
        return GitHubMergeProposalBuilder(self.gh, source_branch, target_branch)
218
217
 
219
 
    def get_proposal(self, source_branch, target_branch):
 
218
    def iter_proposals(self, source_branch, target_branch):
220
219
        (source_owner, source_repo_name, source_branch_name) = (
221
220
            parse_github_url(source_branch))
222
221
        (target_owner, target_repo_name, target_branch_name) = (
223
222
            parse_github_url(target_branch))
224
 
        target_repo = self.gh.get_repo("%s/%s" % (target_owner, target_repo_name))
 
223
        target_repo = self.gh.get_repo(
 
224
            "%s/%s" % (target_owner, target_repo_name))
225
225
        for pull in target_repo.get_pulls(head=target_branch_name):
226
226
            if pull.head.ref != source_branch_name:
227
227
                continue
228
228
            if (pull.head.repo.owner.login != source_owner or
229
229
                    pull.head.repo.name != source_repo_name):
230
230
                continue
231
 
            return GitHubMergeProposal(pull)
232
 
        raise NoMergeProposal()
 
231
            yield GitHubMergeProposal(pull)
233
232
 
234
233
    def hosts(self, branch):
235
234
        try: