scm: darcs: 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@5433 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-04-12 05:45:37 +00:00
parent fbf23a14b8
commit 37c6480e44
1 changed files with 5 additions and 1 deletions

View File

@ -42,7 +42,11 @@ class Repository::Darcs < Repository
end end
def entries(path=nil, identifier=nil) def entries(path=nil, identifier=nil)
patch = identifier.nil? ? nil : changesets.find_by_revision(identifier) patch = nil
if ! identifier.nil?
patch = changesets.find_by_revision(identifier)
return nil if patch.nil?
end
entries = scm.entries(path, patch.nil? ? nil : patch.scmid) entries = scm.entries(path, patch.nil? ? nil : patch.scmid)
if entries if entries
entries.each do |entry| entries.each do |entry|