From 7b983024f51f9c1e72d4acbb693d6982492c8a3e Mon Sep 17 00:00:00 2001 From: ievgenii vdovenko Date: Mon, 4 Aug 2025 15:15:46 +0200 Subject: [PATCH] feature: changes an info message for closing pull request branch --- rhodecode/model/pull_request.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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)