Merge ~ilasc/launchpad:bug-530505 into launchpad:master

Proposed by Ioana Lasc
Status: Merged
Approved by: Colin Watson
Approved revision: c363c5165e98a18704cbb7439ac3c36ea17ad224
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~ilasc/launchpad:bug-530505
Merge into: launchpad:master
Diff against target: 55 lines (+20/-2)
3 files modified
lib/lp/code/interfaces/branchmergeproposal.py (+1/-1)
lib/lp/code/model/branchmergeproposal.py (+1/-1)
lib/lp/code/model/tests/test_branchmergeproposal.py (+18/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+374197@code.launchpad.net

Commit message

Made Subject not required in apidoc parameters for branch_merge_proposal.createComment.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Needs Fixing
Revision history for this message
Ioana Lasc (ilasc) wrote :

Test was moved to appropriate file. Branch is now ready for a second review.

Revision history for this message
Colin Watson (cjwatson) wrote :

Looks good to me now, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/lp/code/interfaces/branchmergeproposal.py b/lib/lp/code/interfaces/branchmergeproposal.py
index 54bef77..fa37faf 100644
--- a/lib/lp/code/interfaces/branchmergeproposal.py
+++ b/lib/lp/code/interfaces/branchmergeproposal.py
@@ -692,7 +692,7 @@ class IBranchMergeProposalAnyAllowedPerson(IBugLinkTarget):
692 @call_with(owner=REQUEST_USER)692 @call_with(owner=REQUEST_USER)
693 # ICodeReviewComment supplied as Interface to avoid circular imports.693 # ICodeReviewComment supplied as Interface to avoid circular imports.
694 @export_factory_operation(Interface, [])694 @export_factory_operation(Interface, [])
695 def createComment(owner, subject, content=None, vote=None,695 def createComment(owner, subject=None, content=None, vote=None,
696 review_type=None, parent=None,696 review_type=None, parent=None,
697 previewdiff_id=None, inline_comments=None):697 previewdiff_id=None, inline_comments=None):
698 """Create an ICodeReviewComment associated with this merge proposal.698 """Create an ICodeReviewComment associated with this merge proposal.
diff --git a/lib/lp/code/model/branchmergeproposal.py b/lib/lp/code/model/branchmergeproposal.py
index 0241e7c..5ebcf04 100644
--- a/lib/lp/code/model/branchmergeproposal.py
+++ b/lib/lp/code/model/branchmergeproposal.py
@@ -998,7 +998,7 @@ class BranchMergeProposal(SQLBase, BugLinkTargetMixin):
998 stop=self.target_git_commit_sha1,998 stop=self.target_git_commit_sha1,
999 union_repository=self.target_git_repository)999 union_repository=self.target_git_repository)
10001000
1001 def createComment(self, owner, subject, content=None, vote=None,1001 def createComment(self, owner, subject=None, content=None, vote=None,
1002 review_type=None, parent=None, _date_created=DEFAULT,1002 review_type=None, parent=None, _date_created=DEFAULT,
1003 previewdiff_id=None, inline_comments=None,1003 previewdiff_id=None, inline_comments=None,
1004 _notify_listeners=True):1004 _notify_listeners=True):
diff --git a/lib/lp/code/model/tests/test_branchmergeproposal.py b/lib/lp/code/model/tests/test_branchmergeproposal.py
index c899c10..a533d4b 100644
--- a/lib/lp/code/model/tests/test_branchmergeproposal.py
+++ b/lib/lp/code/model/tests/test_branchmergeproposal.py
@@ -2543,6 +2543,24 @@ class TestBranchMergeProposalInlineComments(TestCaseWithFactory):
2543 self.assertEqual(1, len(self.getInlineComments()))2543 self.assertEqual(1, len(self.getInlineComments()))
2544 self.assertEqual(1, self.bmp.all_comments.count())2544 self.assertEqual(1, self.bmp.all_comments.count())
25452545
2546 def test_publish_no_subject_on_comment(self):
2547 # Not passing in a Subject when creating a comment
2548 # does not fail and the MP comment is created
2549 # with the default subject.
2550 self.bmp.createComment(
2551 owner=self.bmp.registrant,
2552 previewdiff_id=self.previewdiff.id,
2553 inline_comments=None,
2554 content='Test comment'
2555 )
2556 self.assertEqual(1, self.bmp.all_comments.count())
2557 comment = self.bmp.all_comments[0]
2558 self.assertEqual('Test comment', comment.message.chunks[0].content)
2559 self.assertEqual(
2560 'Re: [Merge] %s into %s' % (
2561 self.bmp.source_branch.bzr_identity,
2562 self.bmp.target_branch.bzr_identity), comment.message.subject)
2563
2546 def test_publish_no_inlines(self):2564 def test_publish_no_inlines(self):
2547 # Suppressing 'inline_comments' does not result in any inline2565 # Suppressing 'inline_comments' does not result in any inline
2548 # comments, but the MP comment itself is created.2566 # comments, but the MP comment itself is created.

Subscribers

People subscribed via source and target branches

to status/vote changes: