]> source.dussan.org Git - redmine.git/commitdiff
scm: cvs: fix missing author, revision and comment in tree view (#4270).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 11 Mar 2011 12:06:05 +0000 (12:06 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 11 Mar 2011 12:06:05 +0000 (12:06 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5093 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/cvs.rb
test/unit/repository_cvs_test.rb

index b4fcfd65c259c2aff5969b7f55ae438ed1cff387..be10e64a38345fe0f3bbb4316ed62bfd164a6430 100644 (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
index 0fd81615b625a5fd7d9be7f2dacdae4bb95e6f31..2d5db034d8e025596845c6172b585b92bdd6dbe5 100644 (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