~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-08-02 10:38:21 UTC
  • mto: This revision was merged to the branch mainline in revision 6555.
  • Revision ID: jelmer@samba.org-20120802103821-pto2dgacjtmpzl1n
Move color feature into bzrlib.tests.features.

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
            })
138
138
        return body
139
139
 
140
 
    def get_source_revid(self):
141
 
        """Get the revision ID of the source branch."""
142
 
        source_branch = self.source_branch.bzr
143
 
        source_branch.lock_read()
144
 
        try:
145
 
            return source_branch.last_revision()
146
 
        finally:
147
 
            source_branch.unlock()
148
 
 
149
140
    def check_proposal(self):
150
141
        """Check that the submission is sensible."""
151
142
        if self.source_branch.lp.self_link == self.target_branch.lp.self_link:
189
180
                error_lines.append(line)
190
181
            raise Exception(''.join(error_lines))
191
182
 
192
 
    def approve_proposal(self, mp):
193
 
        revid = self.get_source_revid()
194
 
        self.call_webservice(
195
 
            mp.createComment,
196
 
            vote=u'Approve',
197
 
            subject='', # Use the default subject.
198
 
            content=u"Rubberstamp! Proposer approves of own proposal.")
199
 
        self.call_webservice(mp.setStatus, status=u'Approved', revid=revid)
200
 
 
201
183
    def create_proposal(self):
202
184
        """Perform the submission."""
203
185
        prerequisite_branch = self._get_prerequisite_branch()
221
203
            commit_message=self.commit_message, reviewers=reviewers,
222
204
            review_types=review_types)
223
205
        if self.approve:
224
 
            self.approve_proposal(mp)
 
206
            self.call_webservice(mp.setStatus, status='Approved')
225
207
        if self.fixes:
226
208
            if self.fixes.startswith('lp:'):
227
209
                self.fixes = self.fixes[3:]