From c4616e0ae0d4db4d5d6e5cc1bca4b6485f1ec9de Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Tue, 12 Apr 2011 05:44:10 +0000 Subject: [PATCH] scm: cvs: model entries returns nil if revision is not stored in database. Prevent showing invalid revision in repository tab. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5431 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository/cvs.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/repository/cvs.rb b/app/models/repository/cvs.rb index c11500c56..d2504ff06 100644 --- a/app/models/repository/cvs.rb +++ b/app/models/repository/cvs.rb @@ -42,9 +42,13 @@ class Repository::Cvs < Repository rev = identifier.nil? ? nil : changesets.find_by_revision(identifier) scm.entry(path, rev.nil? ? nil : rev.committed_on) end - + def entries(path=nil, identifier=nil) - rev = identifier.nil? ? nil : changesets.find_by_revision(identifier) + rev = nil + if ! identifier.nil? + rev = changesets.find_by_revision(identifier) + return nil if rev.nil? + end entries = scm.entries(path, rev.nil? ? nil : rev.committed_on) if entries entries.each() do |entry|