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
This commit is contained in:
Toshi MARUYAMA 2011-04-12 05:44:10 +00:00
parent 3bff6eb660
commit c4616e0ae0
1 changed files with 6 additions and 2 deletions

View File

@ -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|