Commit 63e532eff01ac927e7fa39781d9ebd61503c9a3e
1 parent
967d42e0
Exists in
master
and in
4 other branches
Cache MR diffs result. Improve diff output
Showing
6 changed files
with
10 additions
and
8 deletions
Show diff stats
Procfile
app/controllers/projects/merge_requests_controller.rb
app/models/merge_request.rb
... | ... | @@ -116,7 +116,7 @@ class MergeRequest < ActiveRecord::Base |
116 | 116 | end |
117 | 117 | |
118 | 118 | def diffs |
119 | - load_diffs(st_diffs) || [] | |
119 | + @diffs ||= (load_diffs(st_diffs) || []) | |
120 | 120 | end |
121 | 121 | |
122 | 122 | def reloaded_diffs |
... | ... | @@ -128,6 +128,8 @@ class MergeRequest < ActiveRecord::Base |
128 | 128 | |
129 | 129 | def broken_diffs? |
130 | 130 | diffs == broken_diffs |
131 | + rescue | |
132 | + true | |
131 | 133 | end |
132 | 134 | |
133 | 135 | def valid_diffs? | ... | ... |
app/views/projects/merge_requests/_show.html.haml
... | ... | @@ -21,7 +21,8 @@ |
21 | 21 | .notes.tab-content.voting_notes#notes{ class: (controller.action_name == 'show') ? "" : "hide" } |
22 | 22 | = render "projects/notes/notes_with_form" |
23 | 23 | .diffs.tab-content |
24 | - = render "projects/merge_requests/show/diffs" if @diffs | |
24 | + - if current_page?(action: 'diffs') | |
25 | + = render "projects/merge_requests/show/diffs" | |
25 | 26 | .status |
26 | 27 | |
27 | 28 | :javascript | ... | ... |
app/views/projects/merge_requests/show/_diffs.html.haml
doc/install/installation.md
... | ... | @@ -184,11 +184,11 @@ You can change `5-3-stable` to `master` if you want the *bleeding edge* version, |
184 | 184 | sudo chmod -R u+rwX public/uploads |
185 | 185 | |
186 | 186 | # Copy the example Puma config |
187 | - sudo -u git -H cp config/puma.rb.example config/puma.rb | |
187 | + sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb | |
188 | 188 | |
189 | 189 | # Enable cluster mode if you expect to have a high load instance |
190 | 190 | # Ex. change amount of workers to 3 for 2GB RAM server |
191 | - sudo -u git -H vim config/puma.rb | |
191 | + sudo -u git -H vim config/unicorn.rb | |
192 | 192 | |
193 | 193 | # Configure Git global settings for git user, useful when editing via web |
194 | 194 | # Edit user.email according to what is set in gitlab.yml |
... | ... | @@ -196,7 +196,7 @@ You can change `5-3-stable` to `master` if you want the *bleeding edge* version, |
196 | 196 | sudo -u git -H git config --global user.email "gitlab@localhost" |
197 | 197 | |
198 | 198 | **Important Note:** |
199 | -Make sure to edit both `gitlab.yml` and `puma.rb` to match your setup. | |
199 | +Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup. | |
200 | 200 | |
201 | 201 | ## Configure GitLab DB settings |
202 | 202 | ... | ... |