/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

Add allow-collaboration flag.

Merged from https://code.launchpad.net/~jelmer/brz/allow-collaboration/+merge/380390

Show diffs side-by-side

added added

removed removed

Lines of Context:
280
280
            return json.loads(response.text)
281
281
        raise InvalidHttpResponse(path, response.text)
282
282
 
283
 
    def _create_pull(self, path, title, head, base, body=None, labels=None, assignee=None, draft=False):
 
283
    def _create_pull(self, path, title, head, base, body=None, labels=None,
 
284
                     assignee=None, draft=False, maintainers_can_modify=False):
284
285
        data = {
285
286
            'title': title,
286
287
            'head': head,
287
288
            'base': base,
288
289
            'draft': draft,
 
290
            'maintainers_can_modify': maintainers_can_modify,
289
291
        }
290
292
        if labels is not None:
291
293
            data['labels'] = labels
556
558
 
557
559
    def create_proposal(self, description, reviewers=None, labels=None,
558
560
                        prerequisite_branch=None, commit_message=None,
559
 
                        work_in_progress=False):
 
561
                        work_in_progress=False, allow_collaboration=False):
560
562
        """Perform the submission."""
561
563
        if prerequisite_branch is not None:
562
564
            raise PrerequisiteBranchUnsupported(self)
587
589
                head="%s:%s" % (self.source_owner, self.source_branch_name),
588
590
                base=self.target_branch_name,
589
591
                labels=labels, assignee=assignees,
590
 
                draft=work_in_progress)
 
592
                draft=work_in_progress,
 
593
                maintainer_can_modify=allow_collaboration,
 
594
                )
591
595
        except ValidationFailed:
592
596
            raise MergeProposalExists(self.source_branch.user_url)
593
597
        return GitHubMergeProposal(self.gh, pull_request)