Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
8d7dc26d
Commit
8d7dc26d
authored
Jun 20, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support new diff notes on MRs with diff_refs
parent
2f30d004
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
1 deletion
+12
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-0
app/models/deployment.rb
app/models/deployment.rb
+6
-0
app/models/diff_note.rb
app/models/diff_note.rb
+1
-1
app/models/merge_request.rb
app/models/merge_request.rb
+4
-0
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
8d7dc26d
...
...
@@ -85,6 +85,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
noteable_id:
@merge_request
.
id
}
@use_legacy_diff_notes
=
!
@merge_request
.
support_new_diff_notes?
@grouped_diff_notes
=
@merge_request
.
notes
.
grouped_diff_notes
Banzai
::
NoteRenderer
.
render
(
...
...
app/models/deployment.rb
View file @
8d7dc26d
...
...
@@ -11,6 +11,8 @@ class Deployment < ActiveRecord::Base
delegate
:name
,
to: :environment
,
prefix:
true
after_save
:keep_around_commit
def
commit
project
.
commit
(
sha
)
end
...
...
@@ -26,4 +28,8 @@ class Deployment < ActiveRecord::Base
def
last?
self
==
environment
.
last_deployment
end
def
keep_around_commit
project
.
repository
.
keep_around
(
self
.
sha
)
end
end
app/models/diff_note.rb
View file @
8d7dc26d
...
...
@@ -74,7 +74,7 @@ class DiffNote < Note
private
def
supported?
!
self
.
for_merge_request?
!
self
.
for_merge_request?
||
self
.
noteable
.
support_new_diff_notes?
end
def
set_original_position
...
...
app/models/merge_request.rb
View file @
8d7dc26d
...
...
@@ -642,6 +642,10 @@ class MergeRequest < ActiveRecord::Base
merge_commit
end
def
support_new_diff_notes?
diff_refs
&&
diff_refs
.
complete?
end
def
keep_around_commit
project
.
repository
.
keep_around
(
self
.
merge_commit_sha
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment