Commit 12c5dcbd authored by Toshi MARUYAMA's avatar Toshi MARUYAMA Committed by Eric Davis

scm: cvs: fix CVS diffs do not handle new files properly (#7615).

Contributed by Jim Naslund.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4939 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 5fe46b21
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment