summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-05 15:54:51 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-02-05 15:54:51 +0200
commit68249f23dacbddf61ca296a7decf98ecf6fc16fb (patch)
treeee71906a02468a137413751e70feb908ae19a4d2
parentd701d5869516142a4073804622503299202cfbe2 (diff)
downloadgitlab-ce-68249f23dacbddf61ca296a7decf98ecf6fc16fb.tar.gz
Prevent Compare page timout for large amount of commits
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--CHANGELOG1
-rw-r--r--app/assets/stylesheets/generic/lists.scss6
-rw-r--r--app/views/projects/compare/show.html.haml9
3 files changed, 15 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 06008e78d6b..57a89a4c173 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,6 @@
v 6.6.0
- Permissions: Developer now can manage issue tracker (modify any issue)
+ - Improve Code Compare page performance
v 6.5.1
- Fix branch selectbox when create merge request from fork
diff --git a/app/assets/stylesheets/generic/lists.scss b/app/assets/stylesheets/generic/lists.scss
index 245cccf855d..de70e47333f 100644
--- a/app/assets/stylesheets/generic/lists.scss
+++ b/app/assets/stylesheets/generic/lists.scss
@@ -23,6 +23,12 @@
}
}
+ &.warning-row {
+ background-color: #fcf8e3;
+ border-color: #faebcc;
+ color: #8a6d3b;
+ }
+
&.smoke { background-color: #f5f5f5; }
&:hover {
diff --git a/app/views/projects/compare/show.html.haml b/app/views/projects/compare/show.html.haml
index e9456c24960..6b0b12a3ee0 100644
--- a/app/views/projects/compare/show.html.haml
+++ b/app/views/projects/compare/show.html.haml
@@ -15,7 +15,14 @@
%div.ui-box
.title
Commits (#{@commits.count})
- %ul.well-list= render Commit.decorate(@commits), project: @project
+ - if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
+ %ul.well-list
+ - Commit.decorate(@commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)).each do |commit|
+ = render "projects/commits/inline_commit", commit: commit, project: @project
+ %li.warning-row.unstyled
+ other #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} commits hidden to prevent performance issues.
+ - else
+ %ul.well-list= render Commit.decorate(@commits), project: @project
- unless @diffs.empty?
%h4 Diff