GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 70fa9d56 authored by Douwe Maan's avatar Douwe Maan

Don't mark merge request as updated when merge status relative to target branch changes.

parent bc4e2518
...@@ -27,6 +27,7 @@ v 7.10.0 (unreleased) ...@@ -27,6 +27,7 @@ v 7.10.0 (unreleased)
- Restrict permissions on backup files - Restrict permissions on backup files
- Improve oauth accounts UI in profile page - Improve oauth accounts UI in profile page
- Add ability to unlink connected accounts - Add ability to unlink connected accounts
- Don't mark merge request as updated when merge status relative to target branch changes.
v 7.9.0 v 7.9.0
- Add HipChat integration documentation (Stan Hu) - Add HipChat integration documentation (Stan Hu)
......
...@@ -105,6 +105,15 @@ class MergeRequest < ActiveRecord::Base ...@@ -105,6 +105,15 @@ class MergeRequest < ActiveRecord::Base
state :unchecked state :unchecked
state :can_be_merged state :can_be_merged
state :cannot_be_merged state :cannot_be_merged
around_transition do |merge_request, transition, block|
merge_request.record_timestamps = false
begin
block.call
ensure
merge_request.record_timestamps = true
end
end
end end
validates :source_project, presence: true, unless: :allow_broken validates :source_project, presence: true, unless: :allow_broken
......
...@@ -53,7 +53,7 @@ def reload_merge_requests ...@@ -53,7 +53,7 @@ def reload_merge_requests
if merge_request.source_branch == @branch_name || force_push? if merge_request.source_branch == @branch_name || force_push?
merge_request.reload_code merge_request.reload_code
update_merge_request(merge_request) merge_request.mark_as_unchecked
else else
mr_commit_ids = merge_request.commits.map(&:id) mr_commit_ids = merge_request.commits.map(&:id)
push_commit_ids = @commits.map(&:id) push_commit_ids = @commits.map(&:id)
...@@ -61,20 +61,14 @@ def reload_merge_requests ...@@ -61,20 +61,14 @@ def reload_merge_requests
if matches.any? if matches.any?
merge_request.reload_code merge_request.reload_code
update_merge_request(merge_request) merge_request.mark_as_unchecked
else else
update_merge_request(merge_request) merge_request.mark_as_unchecked
end end
end end
end end
end end
def update_merge_request(merge_request)
MergeRequests::UpdateService.new(
merge_request.target_project,
@current_user, merge_status: 'unchecked').execute(merge_request)
end
# Add comment about pushing new commits to merge requests # Add comment about pushing new commits to merge requests
def comment_mr_with_commits def comment_mr_with_commits
merge_requests = @project.origin_merge_requests.opened.where(source_branch: @branch_name).to_a merge_requests = @project.origin_merge_requests.opened.where(source_branch: @branch_name).to_a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment