diff --git a/rhodecode/apps/repository/views/repo_pull_requests.py b/rhodecode/apps/repository/views/repo_pull_requests.py --- a/rhodecode/apps/repository/views/repo_pull_requests.py +++ b/rhodecode/apps/repository/views/repo_pull_requests.py @@ -368,6 +368,8 @@ class RepoPullRequestsView(RepoAppView, c.pr_merge_possible = not _merge_check.failed c.pr_merge_message = _merge_check.merge_msg + c.pr_merge_info = MergeCheck.get_merge_conditions(pull_request_latest) + c.pull_request_review_status = _merge_check.review_status if merge_checks: self.request.override_renderer = \ diff --git a/rhodecode/model/pull_request.py b/rhodecode/model/pull_request.py --- a/rhodecode/model/pull_request.py +++ b/rhodecode/model/pull_request.py @@ -1544,6 +1544,38 @@ class MergeCheck(object): log.debug('MergeCheck: is failed: %s', merge_check.failed) return merge_check + @classmethod + def get_merge_conditions(cls, pull_request): + merge_details = {} + + model = PullRequestModel() + use_rebase = model._use_rebase_for_merging(pull_request) + + if use_rebase: + merge_details['merge_strategy'] = dict( + details={}, + message=_('Merge strategy: rebase') + ) + else: + merge_details['merge_strategy'] = dict( + details={}, + message=_('Merge strategy: explicit merge commit') + ) + + close_branch = model._close_branch_before_merging(pull_request) + if close_branch: + repo_type = pull_request.target_repo.repo_type + if repo_type == 'hg': + close_msg = _('Source branch will be closed after merge.') + elif repo_type == 'git': + close_msg = _('Source branch will be deleted after merge.') + + merge_details['close_branch'] = dict( + details={}, + message=close_msg + ) + + return merge_details ChangeTuple = namedtuple('ChangeTuple', ['added', 'common', 'removed', 'total']) diff --git a/rhodecode/public/css/main.less b/rhodecode/public/css/main.less --- a/rhodecode/public/css/main.less +++ b/rhodecode/public/css/main.less @@ -1741,10 +1741,14 @@ BIN_FILENODE = 7 } .pull-request-merge-actions { - height: 30px; + min-height: 30px; padding: 0px 0px; } +.pull-request-merge-info { + padding: 0px 5px 5px 0px; +} + .merge-status { margin-right: 5px; } diff --git a/rhodecode/public/css/rcicons.less b/rhodecode/public/css/rcicons.less --- a/rhodecode/public/css/rcicons.less +++ b/rhodecode/public/css/rcicons.less @@ -62,6 +62,7 @@ .icon-lock:before { content: '\e806'; } /* '' */ .icon-unlock:before { content: '\e807'; } /* '' */ .icon-delete:before { content: '\e808'; } /* '' */ +.icon-false:before { content: '\e808'; } /* '' */ .icon-ok:before { content: '\e809'; } /* '' */ .icon-true:before { content: '\e809'; } /* '' */ diff --git a/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako b/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako --- a/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako +++ b/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako @@ -13,6 +13,7 @@ % endif + % if c.pr_merge_errors.items():