Merge lp:~jml/bzr/rubberstamp into lp:bzr

Proposed by Jonathan Lange
Status: Merged
Approved by: Martin Packman
Approved revision: no longer in the source branch.
Merged at revision: 6571
Proposed branch: lp:~jml/bzr/rubberstamp
Merge into: lp:bzr
Diff against target: 86 lines (+30/-3)
3 files modified
bzrlib/plugins/launchpad/cmds.py (+2/-1)
bzrlib/plugins/launchpad/lp_propose.py (+19/-1)
doc/en/release-notes/bzr-2.6.txt (+9/-1)
To merge this branch: bzr merge lp:~jml/bzr/rubberstamp
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+130850@code.launchpad.net

Commit message

Set approved revision and vote "Approve" when using lp-propose --approve

Description of the change

The common use case for me using lp-propose --approve is when I'm creating a merge proposal that will then be taken up by another system, like tarmac, for processing and landing.

This branch caters to that use case by voting "Approve" and by setting the approved revision. Both of these enable the default tarmac set up to land the merge proposal. Altogether, this makes 'lp-propose --approve' something of a rubberstamping operation.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :
Download full text (3.8 KiB)

That seems like a good feature? Could anyone be surprised by the change and
want the old behavior? Maybe not.

It should be in NEWS.

  vote approve
On 23 Oct 2012 03:30, "Jonathan Lange" <email address hidden> wrote:

> Jonathan Lange has proposed merging lp:~jml/bzr/rubberstamp into lp:bzr.
>
> Commit message:
> Set approved revision and vote "Approve" when using lp-propose --approve
>
> Requested reviews:
> bzr-core (bzr-core)
>
> For more details, see:
> https://code.launchpad.net/~jml/bzr/rubberstamp/+merge/130850
>
> The common use case for me using lp-propose --approve is when I'm creating
> a merge proposal that will then be taken up by another system, like tarmac,
> for processing and landing.
>
> This branch caters to that use case by voting "Approve" and by setting the
> approved revision. Both of these enable the default tarmac set up to land
> the merge proposal. Altogether, this makes 'lp-propose --approve'
> something of a rubberstamping operation.
>
>
> --
> https://code.launchpad.net/~jml/bzr/rubberstamp/+merge/130850
> Your team bzr-core is requested to review the proposed merge of
> lp:~jml/bzr/rubberstamp into lp:bzr.
>
> === modified file 'bzrlib/plugins/launchpad/cmds.py'
> --- bzrlib/plugins/launchpad/cmds.py 2012-07-23 19:19:05 +0000
> +++ bzrlib/plugins/launchpad/cmds.py 2012-10-22 16:29:21 +0000
> @@ -293,7 +293,8 @@
> Option('message', short_name='m', type=unicode,
> help='Commit message.'),
> Option('approve',
> - help='Mark the proposal as approved
> immediately.'),
> + help=('Mark the proposal as approved
> immediately, '
> + 'setting the approved revision to
> tip.')),
> Option('fixes', 'The bug this proposal fixes.', str),
> ListOption('review', short_name='R', type=unicode,
> help='Requested reviewer and optional type.')]
>
> === modified file 'bzrlib/plugins/launchpad/lp_propose.py'
> --- bzrlib/plugins/launchpad/lp_propose.py 2012-02-26 15:43:02 +0000
> +++ bzrlib/plugins/launchpad/lp_propose.py 2012-10-22 16:29:21 +0000
> @@ -137,6 +137,15 @@
> })
> return body
>
> + def get_source_revid(self):
> + """Get the revision ID of the source branch."""
> + source_branch = self.source_branch.bzr
> + source_branch.lock_read()
> + try:
> + return source_branch.last_revision()
> + finally:
> + source_branch.unlock()
> +
> def check_proposal(self):
> """Check that the submission is sensible."""
> if self.source_branch.lp.self_link ==
> self.target_branch.lp.self_link:
> @@ -180,6 +189,15 @@
> error_lines.append(line)
> raise Exception(''.join(error_lines))
>
> + def approve_proposal(self, mp):
> + revid = self.get_source_revid()
> + self.call_webservice(
> + mp.createComment,
> + vote=u'Approve',
> + subject='', # Use the default subject.
> + content=u"Rubberstamp! Proposer approve...

Read more...

review: Approve
Revision history for this message
Jonathan Lange (jml) wrote :

On 22 October 2012 19:26, Martin Pool <email address hidden> wrote:
> Review: Approve
>

Thanks!

> That seems like a good feature? Could anyone be surprised by the change and
> want the old behavior? Maybe not.
>

That's my thinking. Complete with question marks.

> It should be in NEWS.
>

Which NEWS file?

jml

Revision history for this message
Martin Pool (mbp) wrote :

>Which NEWS file?

I really mean doc/en/release-notes/bzr-2.6.txt, which we merged NEWS into.

--
Martin

Revision history for this message
Jonathan Lange (jml) wrote :

NEWS has been updated. What else needs to happen before this gets merged?

Revision history for this message
Martin Pool (mbp) wrote :

I think you have commit rights? Please go ahead and merge it.

Martin

Revision history for this message
Jonathan Lange (jml) wrote :

I don't know how to tell if I have commit rights. My pqm-submit failed with being unable to verify the key. Have asked mgz on IRC to merge.

Revision history for this message
Jonathan Lange (jml) wrote :

sent to pqm by email

Revision history for this message
Martin Packman (gz) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/plugins/launchpad/cmds.py'
--- bzrlib/plugins/launchpad/cmds.py 2012-07-23 19:19:05 +0000
+++ bzrlib/plugins/launchpad/cmds.py 2012-10-23 10:25:24 +0000
@@ -293,7 +293,8 @@
293 Option('message', short_name='m', type=unicode,293 Option('message', short_name='m', type=unicode,
294 help='Commit message.'),294 help='Commit message.'),
295 Option('approve',295 Option('approve',
296 help='Mark the proposal as approved immediately.'),296 help=('Mark the proposal as approved immediately, '
297 'setting the approved revision to tip.')),
297 Option('fixes', 'The bug this proposal fixes.', str),298 Option('fixes', 'The bug this proposal fixes.', str),
298 ListOption('review', short_name='R', type=unicode,299 ListOption('review', short_name='R', type=unicode,
299 help='Requested reviewer and optional type.')]300 help='Requested reviewer and optional type.')]
300301
=== modified file 'bzrlib/plugins/launchpad/lp_propose.py'
--- bzrlib/plugins/launchpad/lp_propose.py 2012-02-26 15:43:02 +0000
+++ bzrlib/plugins/launchpad/lp_propose.py 2012-10-23 10:25:24 +0000
@@ -137,6 +137,15 @@
137 })137 })
138 return body138 return body
139139
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
140 def check_proposal(self):149 def check_proposal(self):
141 """Check that the submission is sensible."""150 """Check that the submission is sensible."""
142 if self.source_branch.lp.self_link == self.target_branch.lp.self_link:151 if self.source_branch.lp.self_link == self.target_branch.lp.self_link:
@@ -180,6 +189,15 @@
180 error_lines.append(line)189 error_lines.append(line)
181 raise Exception(''.join(error_lines))190 raise Exception(''.join(error_lines))
182191
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
183 def create_proposal(self):201 def create_proposal(self):
184 """Perform the submission."""202 """Perform the submission."""
185 prerequisite_branch = self._get_prerequisite_branch()203 prerequisite_branch = self._get_prerequisite_branch()
@@ -203,7 +221,7 @@
203 commit_message=self.commit_message, reviewers=reviewers,221 commit_message=self.commit_message, reviewers=reviewers,
204 review_types=review_types)222 review_types=review_types)
205 if self.approve:223 if self.approve:
206 self.call_webservice(mp.setStatus, status='Approved')224 self.approve_proposal(mp)
207 if self.fixes:225 if self.fixes:
208 if self.fixes.startswith('lp:'):226 if self.fixes.startswith('lp:'):
209 self.fixes = self.fixes[3:]227 self.fixes = self.fixes[3:]
210228
=== modified file 'doc/en/release-notes/bzr-2.6.txt'
--- doc/en/release-notes/bzr-2.6.txt 2012-10-13 15:05:46 +0000
+++ doc/en/release-notes/bzr-2.6.txt 2012-10-23 10:25:24 +0000
@@ -15,6 +15,9 @@
1515
16.. These may require users to change the way they use Bazaar.16.. These may require users to change the way they use Bazaar.
1717
18* ``bzr lp-propose --approve`` now also adds an "Approve" vote to the merge
19 proposal. (Jonathan Lange)
20
18New Features21New Features
19************22************
2023
@@ -43,7 +46,12 @@
4346
44* Local configurations files (i.e. accessed on the local file system like47* Local configurations files (i.e. accessed on the local file system like
45 ``bazaar.conf`` and ``locations.conf``) are now shared, reducing the48 ``bazaar.conf`` and ``locations.conf``) are now shared, reducing the
46 number of IOs when querying a configuation option. (Vincent Ladeuil, #832042)49 number of IOs when querying a configuation option. (Vincent Ladeuil,
50 #832042)
51
52* ``bzr lp-propose --approve`` now correctly specifies the approved revision
53 and provides an "Approve" vote from the proposer, allowing for smoother
54 interaction with downstream merge tools. (Jonathan Lange)
4755
48Bug Fixes56Bug Fixes
49*********57*********