Merge lp:~thumper/launchpad/description-change-email into lp:launchpad

Proposed by Tim Penhey
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 10466
Proposed branch: lp:~thumper/launchpad/description-change-email
Merge into: lp:launchpad
Diff against target: 97 lines (+15/-4)
5 files modified
.bzrignore (+1/-0)
lib/lp/code/adapters/branch.py (+1/-1)
lib/lp/code/adapters/tests/test_branch.py (+2/-0)
lib/lp/code/interfaces/branchmergeproposal.py (+1/-1)
lib/lp/code/mail/tests/test_branchmergeproposal.py (+10/-2)
To merge this branch: bzr merge lp:~thumper/launchpad/description-change-email
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Approve
Review via email: mp+20939@code.launchpad.net

Commit message

Email subscribers when a merge proposal description changes.

Description of the change

Changing the description on a merge proposal doesn't currently cause an email to be sent.

This branch fixes that issue.

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

After a bit of head scratching to figure out how the mail stuff works, this looks fine to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2010-03-05 19:41:41 +0000
+++ .bzrignore 2010-03-09 02:48:27 +0000
@@ -60,4 +60,5 @@
60.testrepository60.testrepository
61.memcache.pid61.memcache.pid
62./pipes62./pipes
63lib/canonical/launchpad/apidoc/wadl-development-*.xml
63tags.new64tags.new
6465
=== modified file 'lib/lp/code/adapters/branch.py'
--- lib/lp/code/adapters/branch.py 2009-10-01 13:25:12 +0000
+++ lib/lp/code/adapters/branch.py 2010-03-09 02:48:27 +0000
@@ -69,7 +69,7 @@
69 delta_values = (69 delta_values = (
70 'registrant', 'source_branch', 'target_branch', 'prerequisite_branch',70 'registrant', 'source_branch', 'target_branch', 'prerequisite_branch',
71 'queue_status', 'queue_position',)71 'queue_status', 'queue_position',)
72 new_values = ('commit_message', 'whiteboard',)72 new_values = ('commit_message', 'whiteboard', 'description')
73 interface = IBranchMergeProposal73 interface = IBranchMergeProposal
7474
75 def __init__(self, **kwargs):75 def __init__(self, **kwargs):
7676
=== modified file 'lib/lp/code/adapters/tests/test_branch.py'
--- lib/lp/code/adapters/tests/test_branch.py 2009-06-25 04:06:00 +0000
+++ lib/lp/code/adapters/tests/test_branch.py 2010-03-09 02:48:27 +0000
@@ -48,11 +48,13 @@
48 registrant=registrant)48 registrant=registrant)
49 old_merge_proposal = BranchMergeProposalDelta.snapshot(merge_proposal)49 old_merge_proposal = BranchMergeProposalDelta.snapshot(merge_proposal)
50 merge_proposal.commit_message = 'Change foo into bar.'50 merge_proposal.commit_message = 'Change foo into bar.'
51 merge_proposal.description = 'Set the description.'
51 merge_proposal.markAsMerged()52 merge_proposal.markAsMerged()
52 delta = BranchMergeProposalDelta.construct(53 delta = BranchMergeProposalDelta.construct(
53 old_merge_proposal, merge_proposal)54 old_merge_proposal, merge_proposal)
54 assert delta is not None55 assert delta is not None
55 self.assertEqual('Change foo into bar.', delta.commit_message)56 self.assertEqual('Change foo into bar.', delta.commit_message)
57 self.assertEqual('Set the description.', delta.description)
56 self.assertEqual(58 self.assertEqual(
57 {'old': BranchMergeProposalStatus.WORK_IN_PROGRESS,59 {'old': BranchMergeProposalStatus.WORK_IN_PROGRESS,
58 'new': BranchMergeProposalStatus.MERGED},60 'new': BranchMergeProposalStatus.MERGED},
5961
=== modified file 'lib/lp/code/interfaces/branchmergeproposal.py'
--- lib/lp/code/interfaces/branchmergeproposal.py 2010-02-26 09:54:20 +0000
+++ lib/lp/code/interfaces/branchmergeproposal.py 2010-03-09 02:48:27 +0000
@@ -97,7 +97,7 @@
97 "If True, this proposal is visible only to subscribers.")))97 "If True, this proposal is visible only to subscribers.")))
9898
99 description = exported(99 description = exported(
100 Text(title=_('Description of the Change'), required=False,100 Text(title=_('Description'), required=False,
101 description=_(101 description=_(
102 "A detailed description of the changes that are being "102 "A detailed description of the changes that are being "
103 "addressed by the branch being proposed to be merged."),103 "addressed by the branch being proposed to be merged."),
104104
=== modified file 'lib/lp/code/mail/tests/test_branchmergeproposal.py'
--- lib/lp/code/mail/tests/test_branchmergeproposal.py 2010-02-17 08:57:04 +0000
+++ lib/lp/code/mail/tests/test_branchmergeproposal.py 2010-03-09 02:48:27 +0000
@@ -135,7 +135,9 @@
135 mailer = BMPMailer.forCreation(bmp, bmp.registrant)135 mailer = BMPMailer.forCreation(bmp, bmp.registrant)
136 ctrl = mailer.generateEmail('baz.quxx@example.com', subscriber)136 ctrl = mailer.generateEmail('baz.quxx@example.com', subscriber)
137 self.assertIn(137 self.assertIn(
138 '\nRequested reviews:\n Review-person (review-person)\n\n-- \n',138 '\nRequested reviews:'
139 '\n Review-person (review-person)'
140 '\n\n-- \n',
139 ctrl.body)141 ctrl.body)
140142
141 def test_forCreation_with_review_request_and_bug(self):143 def test_forCreation_with_review_request_and_bug(self):
@@ -286,6 +288,7 @@
286 old_merge_proposal = BranchMergeProposalDelta.snapshot(merge_proposal)288 old_merge_proposal = BranchMergeProposalDelta.snapshot(merge_proposal)
287 merge_proposal.requestReview()289 merge_proposal.requestReview()
288 merge_proposal.commit_message = 'new commit message'290 merge_proposal.commit_message = 'new commit message'
291 merge_proposal.description = 'change description'
289 mailer = BMPMailer.forModification(292 mailer = BMPMailer.forModification(
290 old_merge_proposal, merge_proposal, merge_proposal.registrant)293 old_merge_proposal, merge_proposal, merge_proposal.registrant)
291 return mailer, subscriber294 return mailer, subscriber
@@ -306,7 +309,8 @@
306 mailer, subscriber = self.makeMergeProposalMailerModification()309 mailer, subscriber = self.makeMergeProposalMailerModification()
307 self.assertEqual(310 self.assertEqual(
308 ' Status: Work in progress => Needs review\n\n'311 ' Status: Work in progress => Needs review\n\n'
309 'Commit Message changed to:\n\nnew commit message',312 'Commit Message changed to:\n\nnew commit message\n\n'
313 'Description changed to:\n\nchange description',
310 mailer.textDelta())314 mailer.textDelta())
311315
312 def test_generateEmail(self):316 def test_generateEmail(self):
@@ -327,6 +331,10 @@
327Commit Message changed to:331Commit Message changed to:
328332
329new commit message333new commit message
334
335Description changed to:
336
337change description
330--\x20338--\x20
331%s339%s
332%s340%s