Merge branch 'lock_warning' into 'master'
Rename MergeRequest#lock! to #lock_mr!
This commit is contained in:
commit
7a7c01b92a
2 changed files with 5 additions and 5 deletions
|
@ -62,11 +62,11 @@ class MergeRequest < ActiveRecord::Base
|
|||
transition closed: :reopened
|
||||
end
|
||||
|
||||
event :lock do
|
||||
event :lock_mr do
|
||||
transition [:reopened, :opened] => :locked
|
||||
end
|
||||
|
||||
event :unlock do
|
||||
event :unlock_mr do
|
||||
transition locked: :reopened
|
||||
end
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ module MergeRequests
|
|||
# Called when you do merge via GitLab UI
|
||||
class AutoMergeService < BaseMergeService
|
||||
def execute(merge_request, current_user, commit_message)
|
||||
merge_request.lock
|
||||
merge_request.lock_mr
|
||||
|
||||
if Gitlab::Satellite::MergeAction.new(current_user, merge_request).merge!(commit_message)
|
||||
merge_request.merge
|
||||
|
@ -17,11 +17,11 @@ module MergeRequests
|
|||
|
||||
true
|
||||
else
|
||||
merge_request.unlock
|
||||
merge_request.unlock_mr
|
||||
false
|
||||
end
|
||||
rescue
|
||||
merge_request.unlock if merge_request.locked?
|
||||
merge_request.unlock_mr if merge_request.locked?
|
||||
merge_request.mark_as_unmergeable
|
||||
false
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue