diff --git a/rhodecode/model/pull_request.py b/rhodecode/model/pull_request.py index b4734db2..21557a6b 100644 --- a/rhodecode/model/pull_request.py +++ b/rhodecode/model/pull_request.py @@ -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)