Index: test/functional/repositories_cvs_controller_test.rb =================================================================== --- test/functional/repositories_cvs_controller_test.rb (revision 4820) +++ test/functional/repositories_cvs_controller_test.rb (working copy) @@ -154,6 +154,26 @@ assert_tag :tag => 'td', :attributes => { :class => 'line-code diff_in' }, :content => /watched.remove_all_watcher/ end + + def test_diff_new_files + @repository.fetch_changesets + @repository.reload + get :diff, :id => PRJ_ID, :rev => 1, :type => 'inline' + assert_response :success + assert_template 'diff' + assert_tag :tag => 'td', :attributes => { :class => 'line-code diff_out' }, + :content => /watched.remove_watcher/ + assert_tag :tag => 'td', :attributes => { :class => 'line-code diff_in' }, + :content => /watched.remove_all_watcher/ + assert_tag :tag => 'th', :attributes => { :class => 'filename' }, + :content => /test\/README Thu Dec 13 11:25:10 2007/ + assert_tag :tag => 'th', :attributes => { :class => 'filename' }, + :content => /test\/images\/delete.png Thu Dec 13 11:25:10 2007/ + assert_tag :tag => 'th', :attributes => { :class => 'filename' }, + :content => /test\/images\/edit.png Thu Dec 13 11:25:10 2007/ + assert_tag :tag => 'th', :attributes => { :class => 'filename' }, + :content => /test\/sources\/watchers_controller.rb Thu Dec 13 11:25:10 2007/ + end def test_annotate @repository.fetch_changesets Index: lib/redmine/scm/adapters/cvs_adapter.rb =================================================================== --- lib/redmine/scm/adapters/cvs_adapter.rb (revision 4820) +++ lib/redmine/scm/adapters/cvs_adapter.rb (working copy) @@ -346,7 +346,11 @@ private def buildRevision(rev) if rev== 0 - @base + if @branchid.nil? + @base+".0" + else + @base + end elsif @branchid.nil? @base+"."+rev.to_s else Index: lib/redmine/unified_diff.rb =================================================================== --- lib/redmine/unified_diff.rb (revision 4820) +++ lib/redmine/unified_diff.rb (working copy) @@ -28,7 +28,7 @@ diff_table = DiffTable.new(diff_type) diff.each do |line| unless diff_table.add_line line - self << diff_table if diff_table.length > 1 + self << diff_table diff_table = DiffTable.new(diff_type) end lines += 1