~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/launchpad/lp_propose.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-04 18:21:04 UTC
  • mfrom: (6468.4.3 509275-lp-fixes)
  • Revision ID: pqm@pqm.ubuntu.com-20120304182104-8y1tdavoblrrhflc
(jelmer) Add --link-bug option to 'bzr lp-propose'. (Ross Lagerwall)

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    hooks = ProposeMergeHooks()
53
53
 
54
54
    def __init__(self, tree, source_branch, target_branch, message, reviews,
55
 
                 staging=False, approve=False):
 
55
                 staging=False, approve=False, fixes=None):
56
56
        """Constructor.
57
57
 
58
58
        :param tree: The working tree for the source branch.
90
90
                            for reviewer, review_type in
91
91
                            reviews]
92
92
        self.approve = approve
 
93
        self.fixes = fixes
93
94
 
94
95
    def get_comment(self, prerequisite_branch):
95
96
        """Determine the initial comment for the merge proposal."""
203
204
            review_types=review_types)
204
205
        if self.approve:
205
206
            self.call_webservice(mp.setStatus, status='Approved')
 
207
        if self.fixes:
 
208
            if self.fixes.startswith('lp:'):
 
209
                self.fixes = self.fixes[3:]
 
210
            self.call_webservice(
 
211
                self.source_branch.lp.linkBug,
 
212
                bug=self.launchpad.bugs[int(self.fixes)])
206
213
        webbrowser.open(lp_api.canonical_url(mp))
207
214
 
208
215