feature: changes an info message for closing pull request branch

This commit is contained in:
ievgenii vdovenko 2025-08-04 15:15:46 +02:00
parent 51bb9e8d14
commit 7b983024f5

View file

@ -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)