summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2015-01-18 16:13:05 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2015-01-18 16:13:05 +0000
commit6cc1f2be5439c177583c2c45ae7aebdc8d056895 (patch)
tree4e07e889adfda181815817423c0ec8650176d94c
parente4a3fc50b27e9d4bb0d4d15a4a9480aef800ce25 (diff)
downloadredmine-6cc1f2be5439c177583c2c45ae7aebdc8d056895.tar.gz
redmine-6cc1f2be5439c177583c2c45ae7aebdc8d056895.zip
workaround unit cvs test failure on sqlite3
git-svn-id: http://svn.redmine.org/redmine/trunk@13901 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/repository/cvs.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/models/repository/cvs.rb b/app/models/repository/cvs.rb
index e61ede50d..9503e98a1 100644
--- a/app/models/repository/cvs.rb
+++ b/app/models/repository/cvs.rb
@@ -57,9 +57,16 @@ class Repository::Cvs < Repository
if entries
entries.each() do |entry|
if ( ! entry.lastrev.nil? ) && ( ! entry.lastrev.revision.nil? )
- change = filechanges.find_by_revision_and_path(
- entry.lastrev.revision,
- scm.with_leading_slash(entry.path) )
+ if ActiveRecord::Base.connection.adapter_name =~ /sqlite/i &&
+ Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR == 2 &&
+ Rails::VERSION::TINY == 0
+ change_rev = filechanges.where(:revision => entry.lastrev.revision)
+ change = change_rev.find { |c| c.path == scm.with_leading_slash(entry.path) }
+ else
+ change = filechanges.where(
+ :revision => entry.lastrev.revision,
+ :path => scm.with_leading_slash(entry.path)).first
+ end
if change
entry.lastrev.identifier = change.changeset.revision
entry.lastrev.revision = change.changeset.revision