Show More
@@ -907,15 +907,20 b' class PullRequestModel(BaseModel):' | |||||
907 | """ |
|
907 | """ | |
908 | Try to merge the pull request and return the merge status. |
|
908 | Try to merge the pull request and return the merge status. | |
909 | """ |
|
909 | """ | |
|
910 | log.debug( | |||
|
911 | "Trying out if the pull request %s can be merged.", | |||
|
912 | pull_request.pull_request_id) | |||
910 | target_vcs = pull_request.target_repo.scm_instance() |
|
913 | target_vcs = pull_request.target_repo.scm_instance() | |
911 | target_ref = self._refresh_reference( |
|
914 | target_ref = self._refresh_reference( | |
912 | pull_request.target_ref_parts, target_vcs) |
|
915 | pull_request.target_ref_parts, target_vcs) | |
913 |
|
916 | |||
914 | target_locked = pull_request.target_repo.locked |
|
917 | target_locked = pull_request.target_repo.locked | |
915 | if target_locked and target_locked[0]: |
|
918 | if target_locked and target_locked[0]: | |
|
919 | log.debug("The target repository is locked.") | |||
916 | merge_state = MergeResponse( |
|
920 | merge_state = MergeResponse( | |
917 | False, False, None, MergeFailureReason.TARGET_IS_LOCKED) |
|
921 | False, False, None, MergeFailureReason.TARGET_IS_LOCKED) | |
918 | elif self._needs_merge_state_refresh(pull_request, target_ref): |
|
922 | elif self._needs_merge_state_refresh(pull_request, target_ref): | |
|
923 | log.debug("Refreshing the merge status of the repository.") | |||
919 | merge_state = self._refresh_merge_state( |
|
924 | merge_state = self._refresh_merge_state( | |
920 | pull_request, target_vcs, target_ref) |
|
925 | pull_request, target_vcs, target_ref) | |
921 | else: |
|
926 | else: | |
@@ -923,6 +928,7 b' class PullRequestModel(BaseModel):' | |||||
923 | _last_merge_status == MergeFailureReason.NONE |
|
928 | _last_merge_status == MergeFailureReason.NONE | |
924 | merge_state = MergeResponse( |
|
929 | merge_state = MergeResponse( | |
925 | possible, False, None, pull_request._last_merge_status) |
|
930 | possible, False, None, pull_request._last_merge_status) | |
|
931 | log.debug("Merge response: %s", merge_state) | |||
926 | return merge_state |
|
932 | return merge_state | |
927 |
|
933 | |||
928 | def _refresh_reference(self, reference, vcs_repository): |
|
934 | def _refresh_reference(self, reference, vcs_repository): |
General Comments 0
You need to be logged in to leave comments.
Login now