BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
28e33df4
Unverified
Commit
28e33df4
authored
Aug 09, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load merge request versions without loading whole diff from database
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
d99d5198
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
merge_request_diff.rb
app/models/merge_request_diff.rb
+4
-0
_versions.html.haml
app/views/projects/merge_requests/show/_versions.html.haml
+4
-4
No files found.
app/models/merge_request_diff.rb
View file @
28e33df4
...
...
@@ -30,6 +30,10 @@ class MergeRequestDiff < ActiveRecord::Base
# It allows you to override variables like head_commit_sha before getting diff.
after_create
:save_git_content
,
unless: :importing?
def
self
.
select_without_diff
select
(
column_names
-
[
'st_diffs'
])
end
# Collect information about commits and diff from repository
# and save it to the database as serialized data
def
save_git_content
...
...
app/views/projects/merge_requests/show/_versions.html.haml
View file @
28e33df4
-
diffs_count
=
@merge_request
.
merge_request_diffs
.
count
-
merge_request_diffs
=
@merge_request
.
merge_request_diffs
.
select_without_diff
-
latest_diff
=
merge_request_diffs
.
first
-
if
diffs_count
>
1
-
latest_diff
=
@merge_request
.
merge_request_diff
-
if
merge_request_diffs
.
size
>
1
.mr-version-switch
Version:
%span
.dropdown.inline
...
...
@@ -13,7 +13,7 @@
#{
@merge_request_diff
.
head_commit
.
short_id
}
%span
.caret
%ul
.dropdown-menu.dropdown-menu-selectable
-
@merge_request
.
merge_request_diffs
.
each
do
|
merge_request_diff
|
-
merge_request_diffs
.
each
do
|
merge_request_diff
|
%li
=
link_to
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
diff_id:
merge_request_diff
.
id
),
class:
(
'is-active'
if
merge_request_diff
==
@merge_request_diff
)
do
%strong
.monospace
...
...
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