summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/redmine/scm/adapters/cvs_adapter.rb6
-rw-r--r--test/functional/repositories_cvs_controller_test.rb18
2 files changed, 23 insertions, 1 deletions
diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb
index 365d44041..25d4e420e 100644
--- a/lib/redmine/scm/adapters/cvs_adapter.rb
+++ b/lib/redmine/scm/adapters/cvs_adapter.rb
@@ -378,7 +378,11 @@ module Redmine
private
def buildRevision(rev)
if rev== 0
- @base
+ if @branchid.nil?
+ @base+".0"
+ else
+ @base
+ end
elsif @branchid.nil?
@base+"."+rev.to_s
else
diff --git a/test/functional/repositories_cvs_controller_test.rb b/test/functional/repositories_cvs_controller_test.rb
index 5e2a1dc91..ca040e3f2 100644
--- a/test/functional/repositories_cvs_controller_test.rb
+++ b/test/functional/repositories_cvs_controller_test.rb
@@ -154,6 +154,24 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
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_in' },
+ :content => /watched.remove_watcher/
+ assert_tag :tag => 'th', :attributes => { :class => 'filename' },
+ :content => /test\/README/
+ assert_tag :tag => 'th', :attributes => { :class => 'filename' },
+ :content => /test\/images\/delete.png /
+ assert_tag :tag => 'th', :attributes => { :class => 'filename' },
+ :content => /test\/images\/edit.png/
+ assert_tag :tag => 'th', :attributes => { :class => 'filename' },
+ :content => /test\/sources\/watchers_controller.rb/
+ end
def test_annotate
@repository.fetch_changesets