launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #32517
[Merge] ~ines-almeida/launchpad:update-is-mergeable into launchpad:master
Ines Almeida has proposed merging ~ines-almeida/launchpad:update-is-mergeable into launchpad:master.
Commit message:
Rename isMergable to isInProgress
Wording makes it clearer what the method is used for
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~ines-almeida/launchpad/+git/launchpad/+merge/486000
Very minor rename. Specially relevant now that we're adding a merge functionality, to reduce confusion
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/launchpad:update-is-mergeable into launchpad:master.
diff --git a/lib/lp/code/browser/branchmergeproposal.py b/lib/lp/code/browser/branchmergeproposal.py
index 9525cb7..27a3358 100644
--- a/lib/lp/code/browser/branchmergeproposal.py
+++ b/lib/lp/code/browser/branchmergeproposal.py
@@ -211,7 +211,7 @@ class BranchMergeProposalMenuMixin:
@enabled_with_permission("launchpad.Edit")
def edit(self):
text = "Edit details"
- enabled = self.context.isMergable()
+ enabled = self.context.isInProgress()
return Link("+edit", text, icon="edit", enabled=enabled)
@enabled_with_permission("launchpad.Edit")
@@ -222,7 +222,7 @@ class BranchMergeProposalMenuMixin:
@enabled_with_permission("launchpad.Edit")
def set_commit_message(self):
text = "Set commit message"
- enabled = self.context.isMergable()
+ enabled = self.context.isInProgress()
return Link("+edit-commit-message", text, icon="add", enabled=enabled)
@enabled_with_permission("launchpad.Edit")
@@ -991,7 +991,7 @@ class BranchMergeProposalVoteView(LaunchpadView):
# the menu link is now shown in the table itself.
can_request_review = (
check_permission("launchpad.Edit", self.context)
- and self.context.isMergable()
+ and self.context.isInProgress()
)
# Show the table if there are review to show, or the user can review,
@@ -1107,7 +1107,7 @@ class BranchMergeProposalRequestReviewView(LaunchpadEditFormView):
def validate(self, data):
"""Ensure that the proposal is in an appropriate state."""
- if not self.context.isMergable():
+ if not self.context.isInProgress():
self.addError(
"The merge proposal is not an a valid state to "
"mark as 'Needs review'."
diff --git a/lib/lp/code/browser/codereviewcomment.py b/lib/lp/code/browser/codereviewcomment.py
index 08db282..af66f1d 100644
--- a/lib/lp/code/browser/codereviewcomment.py
+++ b/lib/lp/code/browser/codereviewcomment.py
@@ -147,7 +147,7 @@ class CodeReviewCommentContextMenu(ContextMenu):
links = ["reply"]
def reply(self):
- enabled = self.context.branch_merge_proposal.isMergable()
+ enabled = self.context.branch_merge_proposal.isInProgress()
return Link("+reply", "Reply", icon="add", enabled=enabled)
diff --git a/lib/lp/code/interfaces/branchmergeproposal.py b/lib/lp/code/interfaces/branchmergeproposal.py
index 9dcbc9d..90f23c3 100644
--- a/lib/lp/code/interfaces/branchmergeproposal.py
+++ b/lib/lp/code/interfaces/branchmergeproposal.py
@@ -580,11 +580,11 @@ class IBranchMergeProposalView(Interface):
def isValidTransition(next_state, user=None):
"""True if it is valid for user update the proposal to next_state."""
- def isMergable():
- """Is the proposal in a state that allows it to being merged?
+ def isInProgress():
+ """Is the proposal still in progress?
- As long as the proposal isn't in one of the end states, it is valid
- to be merged.
+ As long as the proposal isn't in one of the end states, it is active
+ and can eventually be merged.
"""
def getUnlandedSourceBranchRevisions():
diff --git a/lib/lp/code/model/branchmergeproposal.py b/lib/lp/code/model/branchmergeproposal.py
index 277a03e..17168fe 100644
--- a/lib/lp/code/model/branchmergeproposal.py
+++ b/lib/lp/code/model/branchmergeproposal.py
@@ -843,7 +843,7 @@ class BranchMergeProposal(StormBase, BugLinkTargetMixin):
# Clear out any reviewed values.
self._mark_unreviewed()
- def isMergable(self):
+ def isInProgress(self):
"""See `IBranchMergeProposal`."""
# As long as the source branch has not been merged, rejected
# or superseded, then it is valid to be merged.