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
1=== modified file '.bzrignore'
2--- .bzrignore 2010-03-05 19:41:41 +0000
3+++ .bzrignore 2010-03-09 02:48:27 +0000
4@@ -60,4 +60,5 @@
5 .testrepository
6 .memcache.pid
7 ./pipes
8+lib/canonical/launchpad/apidoc/wadl-development-*.xml
9 tags.new
10
11=== modified file 'lib/lp/code/adapters/branch.py'
12--- lib/lp/code/adapters/branch.py 2009-10-01 13:25:12 +0000
13+++ lib/lp/code/adapters/branch.py 2010-03-09 02:48:27 +0000
14@@ -69,7 +69,7 @@
15 delta_values = (
16 'registrant', 'source_branch', 'target_branch', 'prerequisite_branch',
17 'queue_status', 'queue_position',)
18- new_values = ('commit_message', 'whiteboard',)
19+ new_values = ('commit_message', 'whiteboard', 'description')
20 interface = IBranchMergeProposal
21
22 def __init__(self, **kwargs):
23
24=== modified file 'lib/lp/code/adapters/tests/test_branch.py'
25--- lib/lp/code/adapters/tests/test_branch.py 2009-06-25 04:06:00 +0000
26+++ lib/lp/code/adapters/tests/test_branch.py 2010-03-09 02:48:27 +0000
27@@ -48,11 +48,13 @@
28 registrant=registrant)
29 old_merge_proposal = BranchMergeProposalDelta.snapshot(merge_proposal)
30 merge_proposal.commit_message = 'Change foo into bar.'
31+ merge_proposal.description = 'Set the description.'
32 merge_proposal.markAsMerged()
33 delta = BranchMergeProposalDelta.construct(
34 old_merge_proposal, merge_proposal)
35 assert delta is not None
36 self.assertEqual('Change foo into bar.', delta.commit_message)
37+ self.assertEqual('Set the description.', delta.description)
38 self.assertEqual(
39 {'old': BranchMergeProposalStatus.WORK_IN_PROGRESS,
40 'new': BranchMergeProposalStatus.MERGED},
41
42=== modified file 'lib/lp/code/interfaces/branchmergeproposal.py'
43--- lib/lp/code/interfaces/branchmergeproposal.py 2010-02-26 09:54:20 +0000
44+++ lib/lp/code/interfaces/branchmergeproposal.py 2010-03-09 02:48:27 +0000
45@@ -97,7 +97,7 @@
46 "If True, this proposal is visible only to subscribers.")))
47
48 description = exported(
49- Text(title=_('Description of the Change'), required=False,
50+ Text(title=_('Description'), required=False,
51 description=_(
52 "A detailed description of the changes that are being "
53 "addressed by the branch being proposed to be merged."),
54
55=== modified file 'lib/lp/code/mail/tests/test_branchmergeproposal.py'
56--- lib/lp/code/mail/tests/test_branchmergeproposal.py 2010-02-17 08:57:04 +0000
57+++ lib/lp/code/mail/tests/test_branchmergeproposal.py 2010-03-09 02:48:27 +0000
58@@ -135,7 +135,9 @@
59 mailer = BMPMailer.forCreation(bmp, bmp.registrant)
60 ctrl = mailer.generateEmail('baz.quxx@example.com', subscriber)
61 self.assertIn(
62- '\nRequested reviews:\n Review-person (review-person)\n\n-- \n',
63+ '\nRequested reviews:'
64+ '\n Review-person (review-person)'
65+ '\n\n-- \n',
66 ctrl.body)
67
68 def test_forCreation_with_review_request_and_bug(self):
69@@ -286,6 +288,7 @@
70 old_merge_proposal = BranchMergeProposalDelta.snapshot(merge_proposal)
71 merge_proposal.requestReview()
72 merge_proposal.commit_message = 'new commit message'
73+ merge_proposal.description = 'change description'
74 mailer = BMPMailer.forModification(
75 old_merge_proposal, merge_proposal, merge_proposal.registrant)
76 return mailer, subscriber
77@@ -306,7 +309,8 @@
78 mailer, subscriber = self.makeMergeProposalMailerModification()
79 self.assertEqual(
80 ' Status: Work in progress => Needs review\n\n'
81- 'Commit Message changed to:\n\nnew commit message',
82+ 'Commit Message changed to:\n\nnew commit message\n\n'
83+ 'Description changed to:\n\nchange description',
84 mailer.textDelta())
85
86 def test_generateEmail(self):
87@@ -327,6 +331,10 @@
88 Commit Message changed to:
89
90 new commit message
91+
92+Description changed to:
93+
94+change description
95 --\x20
96 %s
97 %s