← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~blr/launchpad/recycle-commit-message into lp:launchpad

 

Bayard 'kit' Randel has proposed merging lp:~blr/launchpad/recycle-commit-message into lp:launchpad.

Commit message:
Preserve commit message on branch merge proposal resubmission.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #676769 in Launchpad itself: "resubmitting a merge proposal should reuse the old commit message"
  https://bugs.launchpad.net/launchpad/+bug/676769

For more details, see:
https://code.launchpad.net/~blr/launchpad/recycle-commit-message/+merge/261793
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~blr/launchpad/recycle-commit-message into lp:launchpad.
=== modified file 'lib/lp/code/browser/branchmergeproposal.py'
--- lib/lp/code/browser/branchmergeproposal.py	2015-06-10 10:25:28 +0000
+++ lib/lp/code/browser/branchmergeproposal.py	2015-06-12 00:11:22 +0000
@@ -1011,6 +1011,7 @@
                 'prerequisite_git_path',
                 ]
         field_names.extend([
+            'commit_message',
             'description',
             'break_link',
             ])
@@ -1044,7 +1045,8 @@
                     merge_prerequisite = None
             proposal = self.context.resubmit(
                 self.user, merge_source, merge_target, merge_prerequisite,
-                data['description'], data['break_link'])
+                data['commit_message'], data['description'],
+                data['break_link'])
         except BranchMergeProposalExists as e:
             message = structured(
                 'Cannot resubmit because <a href="%(url)s">a similar merge'

=== modified file 'lib/lp/code/interfaces/branchmergeproposal.py'
--- lib/lp/code/interfaces/branchmergeproposal.py	2015-06-10 10:25:28 +0000
+++ lib/lp/code/interfaces/branchmergeproposal.py	2015-06-12 00:11:22 +0000
@@ -598,6 +598,8 @@
             proposal (defaults to the current merge_prerequisite).
         :param description: The description for the new proposal (defaults to
             the current description).
+        :param commit_message: The commit message for the new proposal (defaults
+            to the current commit message).
         """
 
     @operation_parameters(

=== modified file 'lib/lp/code/model/branchmergeproposal.py'
--- lib/lp/code/model/branchmergeproposal.py	2015-06-10 10:25:28 +0000
+++ lib/lp/code/model/branchmergeproposal.py	2015-06-12 00:11:22 +0000
@@ -634,8 +634,8 @@
         self.date_merged = date_merged
 
     def resubmit(self, registrant, merge_source=None, merge_target=None,
-                 merge_prerequisite=DEFAULT, description=None,
-                 break_link=False):
+                 merge_prerequisite=DEFAULT, commit_message=None,
+                 description=None, break_link=False):
         """See `IBranchMergeProposal`."""
         if merge_source is None:
             merge_source = self.merge_source
@@ -649,6 +649,8 @@
                 raise BranchMergeProposalExists(proposal)
         if merge_prerequisite is DEFAULT:
             merge_prerequisite = self.merge_prerequisite
+        if commit_message is None:
+            commit_message = self.commit_message
         if description is None:
             description = self.description
         # You can transition from REJECTED to SUPERSEDED, but
@@ -665,6 +667,7 @@
             registrant=registrant,
             merge_target=merge_target,
             merge_prerequisite=merge_prerequisite,
+            commit_message=commit_message,
             description=description,
             needs_review=True, review_requests=review_requests)
         if not break_link:


Follow ups