Remove trailing (revision nn) from filenames in subversion diffs.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10425 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-09-18 19:44:08 +00:00
parent 12de6a177a
commit d277d14432
2 changed files with 5 additions and 2 deletions

View File

@ -124,6 +124,9 @@ module Redmine
# remove leading a/ b/ # remove leading a/ b/
@file_name = arg.sub(%r{^(a|b)/}, '') @file_name = arg.sub(%r{^(a|b)/}, '')
end end
when "Subversion"
# removing trailing "(revision nn)"
@file_name = arg.sub(%r{\t+\(.*\)$}, '')
else else
@file_name = arg @file_name = arg
end end

View File

@ -315,8 +315,8 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
get :diff, :id => PRJ_ID, :rev => 3, :type => dt get :diff, :id => PRJ_ID, :rev => 3, :type => dt
assert_response :success assert_response :success
assert_template 'diff' assert_template 'diff'
assert_tag :tag => 'h2', assert_select 'h2', :text => /Revision 3/
:content => / 3/ assert_select 'th.filename', :text => 'subversion_test/textfile.txt'
end end
end end