feature: changes an info message for closing pull request branch
This commit is contained in:
parent
51bb9e8d14
commit
7b983024f5
1 changed files with 8 additions and 2 deletions
|
|
@ -2424,10 +2424,16 @@ class MergeCheck(object):
|
|||
if close_branch:
|
||||
repo_type = pull_request.target_repo.repo_type
|
||||
close_msg = ""
|
||||
branch_name = pull_request.source_ref_parts.name
|
||||
max_branch_length = 20
|
||||
shorten_branch_name = (
|
||||
f"{branch_name[:max_branch_length]}..." if len(branch_name) > max_branch_length else branch_name
|
||||
)
|
||||
message_template = "Source branch '%s' will be {action} before the merge." % shorten_branch_name
|
||||
if repo_type == "hg":
|
||||
close_msg = _("Source branch will be closed before the merge.")
|
||||
close_msg = _(message_template.format(action="closed"))
|
||||
elif repo_type == "git":
|
||||
close_msg = _("Source branch will be deleted after the merge.")
|
||||
close_msg = _(message_template.format(action="deleted"))
|
||||
|
||||
merge_details["close_branch"] = dict(details={}, message=close_msg)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue