##// END OF EJS Templates
settings: Read 'rebase-merge' config option and pass it to the VCS insntacen on merge.
Martin Bornhold -
r361:813d7f2f default
parent child Browse files
Show More
@@ -425,6 +425,7 b' class PullRequestModel(BaseModel):'
425 425 workspace_id = self._workspace_id(pull_request)
426 426 protocol = rhodecode.CONFIG.get('vcs.hooks.protocol')
427 427 use_direct_calls = rhodecode.CONFIG.get('vcs.hooks.direct_calls')
428 use_rebase = self._use_rebase_for_merging(pull_request)
428 429
429 430 callback_daemon, extras = prepare_callback_daemon(
430 431 extras, protocol=protocol, use_direct_calls=use_direct_calls)
@@ -437,7 +438,7 b' class PullRequestModel(BaseModel):'
437 438 merge_state = target_vcs.merge(
438 439 target_ref, source_vcs, pull_request.source_ref_parts,
439 440 workspace_id, user_name=user.username,
440 user_email=user.email, message=message)
441 user_email=user.email, message=message, use_rebase=use_rebase)
441 442 return merge_state
442 443
443 444 def _comment_and_close_pr(self, pull_request, user, merge_state):
@@ -955,9 +956,10 b' class PullRequestModel(BaseModel):'
955 956 def _refresh_merge_state(self, pull_request, target_vcs, target_reference):
956 957 workspace_id = self._workspace_id(pull_request)
957 958 source_vcs = pull_request.source_repo.scm_instance()
959 use_rebase = self._use_rebase_for_merging(pull_request)
958 960 merge_state = target_vcs.merge(
959 961 target_reference, source_vcs, pull_request.source_ref_parts,
960 workspace_id, dry_run=True)
962 workspace_id, dry_run=True, use_rebase=use_rebase)
961 963
962 964 # Do not store the response if there was an unknown error.
963 965 if merge_state.failure_reason != MergeFailureReason.UNKNOWN:
@@ -1126,6 +1128,11 b' class PullRequestModel(BaseModel):'
1126 1128 settings = settings_model.get_general_settings()
1127 1129 return settings.get('rhodecode_pr_merge_enabled', False)
1128 1130
1131 def _use_rebase_for_merging(self, pull_request):
1132 settings_model = VcsSettingsModel(repo=pull_request.target_repo)
1133 settings = settings_model.get_general_settings()
1134 return settings.get('rhodecode_hg_use_rebase_for_merging', False)
1135
1129 1136 def _log_action(self, action, user, pull_request):
1130 1137 action_logger(
1131 1138 user,
General Comments 0
You need to be logged in to leave comments. Login now