launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #21587
[Merge] lp:~cjwatson/launchpad/mp-setStatus-merged-revision into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/mp-setStatus-merged-revision into lp:launchpad.
Commit message:
Handle revision ID passed to BranchMergeProposal.setStatus for transitions to MERGED.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/mp-setStatus-merged-revision/+merge/324399
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/mp-setStatus-merged-revision into lp:launchpad.
=== modified file 'lib/lp/code/model/branchmergeproposal.py'
--- lib/lp/code/model/branchmergeproposal.py 2017-05-19 15:52:35 +0000
+++ lib/lp/code/model/branchmergeproposal.py 2017-05-22 13:36:23 +0000
@@ -685,7 +685,8 @@
elif status == BranchMergeProposalStatus.REJECTED:
self.rejectBranch(user, revision_id)
elif status == BranchMergeProposalStatus.MERGED:
- self.markAsMerged(merge_reporter=user)
+ self.markAsMerged(
+ merge_reporter=user, merged_revision_id=revision_id)
else:
raise AssertionError('Unexpected queue status: %s' % status)
=== modified file 'lib/lp/code/model/gitref.py'
--- lib/lp/code/model/gitref.py 2017-05-04 16:02:40 +0000
+++ lib/lp/code/model/gitref.py 2017-05-22 13:36:23 +0000
@@ -4,6 +4,7 @@
__metaclass__ = type
__all__ = [
'GitRef',
+ 'GitRefDefault',
'GitRefFrozen',
'GitRefRemote',
]
=== modified file 'lib/lp/code/model/tests/test_branchmergeproposal.py'
--- lib/lp/code/model/tests/test_branchmergeproposal.py 2017-05-19 15:50:01 +0000
+++ lib/lp/code/model/tests/test_branchmergeproposal.py 2017-05-22 13:36:23 +0000
@@ -452,9 +452,12 @@
proposal = self.factory.makeBranchMergeProposal(
target_branch=self.target_branch,
set_state=BranchMergeProposalStatus.WORK_IN_PROGRESS)
- proposal.setStatus(BranchMergeProposalStatus.MERGED)
+ proposal.setStatus(
+ BranchMergeProposalStatus.MERGED, user=self.target_branch.owner,
+ revision_id='1000')
self.assertEqual(proposal.queue_status,
BranchMergeProposalStatus.MERGED)
+ self.assertEqual(proposal.merged_revision_id, '1000')
def test_set_status_invalid_status(self):
# IBranchMergeProposal.setStatus doesn't work in the case of
Follow ups