scm: cvs: fix missing author, revision and comment in tree view (#4270).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5093 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-03-11 12:06:05 +00:00
parent 0d63e9e8fd
commit 099ba68836
2 changed files with 15 additions and 3 deletions

View File

@ -48,15 +48,15 @@ class Repository::Cvs < Repository
entries = scm.entries(path, rev.nil? ? nil : rev.committed_on)
if entries
entries.each() do |entry|
unless entry.lastrev.nil? || entry.lastrev.identifier
if ( ! entry.lastrev.nil? ) && ( ! entry.lastrev.revision.nil? )
change=changes.find_by_revision_and_path(
entry.lastrev.revision,
scm.with_leading_slash(entry.path) )
if change
entry.lastrev.identifier = change.changeset.revision
entry.lastrev.revision = change.changeset.revision
entry.lastrev.author = change.changeset.committer
entry.lastrev.revision = change.revision
entry.lastrev.branch = change.branch
# entry.lastrev.branch = change.branch
end
end
end

View File

@ -89,6 +89,18 @@ class RepositoryCvsTest < ActiveSupport::TestCase
assert entries.detect {|e| e.name == 'watchers_controller.rb'}
assert_nil entries.detect {|e| e.name == 'welcome_controller.rb'}
end
def test_entries_rev3
@repository.fetch_changesets
@repository.reload
entries = @repository.entries('', '3')
assert_equal 3, entries.size
assert_equal entries[2].name, "README"
assert_equal entries[2].lastrev.time, Time.gm(2007, 12, 13, 16, 27, 22)
assert_equal entries[2].lastrev.identifier, '3'
assert_equal entries[2].lastrev.revision, '3'
assert_equal entries[2].lastrev.author, 'LANG'
end
else
puts "CVS test repository NOT FOUND. Skipping unit tests !!!"
def test_fake; assert true end