From: Toshi MARUYAMA Date: Fri, 11 Mar 2011 12:06:05 +0000 (+0000) Subject: scm: cvs: fix missing author, revision and comment in tree view (#4270). X-Git-Tag: 1.2.0~750 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=099ba68836b9ff4544df3c46b6f5cb8a6081a185;p=redmine.git 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 --- diff --git a/app/models/repository/cvs.rb b/app/models/repository/cvs.rb index b4fcfd65c..be10e64a3 100644 --- a/app/models/repository/cvs.rb +++ b/app/models/repository/cvs.rb @@ -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 diff --git a/test/unit/repository_cvs_test.rb b/test/unit/repository_cvs_test.rb index 0fd81615b..2d5db034d 100644 --- a/test/unit/repository_cvs_test.rb +++ b/test/unit/repository_cvs_test.rb @@ -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