summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-08-08 20:11:42 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-08-08 20:11:42 +0000
commitfb20758f1eb0f9a0b27e8c4d804b5af80908f629 (patch)
treed2a91879a35f45b959cbd0031a6d9f51f6416c6a
parent37005ed8bd5c02be1b7734ebb295ab77f908011d (diff)
parent6af4efea872407bf7f3957f3009984989a3a8e8f (diff)
downloadgitlab-ce-fb20758f1eb0f9a0b27e8c4d804b5af80908f629.tar.gz
Merge branch '20129-update-version_sorter-gem-to-optimize-tag-sorting' into 'master'
Update version_sorter and use new interface for faster tag sorting See merge request !5723
-rw-r--r--CHANGELOG1
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock4
-rw-r--r--app/models/repository.rb4
4 files changed, 5 insertions, 6 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b3cfac9e614..951c30d8eef 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -34,6 +34,7 @@ v 8.11.0 (unreleased)
- Retrieve rendered HTML from cache in one request
- Fix renaming repository when name contains invalid chararacters under project settings
- Fix devise deprecation warnings.
+ - Update version_sorter and use new interface for faster tag sorting
- Optimize checking if a user has read access to a list of issues !5370
- Nokogiri's various parsing methods are now instrumented
- Add simple identifier to public SSH keys (muteor)
diff --git a/Gemfile b/Gemfile
index 8f94ee72a32..104929665e8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -154,7 +154,7 @@ gem 'settingslogic', '~> 2.0.9'
# Misc
-gem 'version_sorter', '~> 2.0.0'
+gem 'version_sorter', '~> 2.1.0'
# Cache
gem 'redis-rails', '~> 4.0.0'
diff --git a/Gemfile.lock b/Gemfile.lock
index 870f9397b9e..87f08d6f372 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -778,7 +778,7 @@ GEM
uniform_notifier (1.10.0)
uuid (2.3.8)
macaddr (~> 1.0)
- version_sorter (2.0.0)
+ version_sorter (2.1.0)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
@@ -989,7 +989,7 @@ DEPENDENCIES
unf (~> 0.1.4)
unicorn (~> 4.9.0)
unicorn-worker-killer (~> 0.4.2)
- version_sorter (~> 2.0.0)
+ version_sorter (~> 2.1.0)
virtus (~> 1.0.1)
vmstat (~> 2.1.1)
web-console (~> 2.0)
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 701f867f67c..e56bac509a4 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -636,9 +636,7 @@ class Repository
def tags_sorted_by(value)
case value
when 'name'
- # Would be better to use `sort_by` but `version_sorter` only exposes
- # `sort` and `rsort`
- VersionSorter.rsort(tag_names).map { |tag_name| find_tag(tag_name) }
+ VersionSorter.rsort(tags) { |tag| tag.name }
when 'updated_desc'
tags_sorted_by_committed_date.reverse
when 'updated_asc'