From: Jean-Philippe Lang Date: Tue, 18 Sep 2012 19:44:08 +0000 (+0000) Subject: Remove trailing (revision nn) from filenames in subversion diffs. X-Git-Tag: 2.2.0~364 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d277d14432fb86064e23bd0717a4e7c0fc896d5f;p=redmine.git 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 --- diff --git a/lib/redmine/unified_diff.rb b/lib/redmine/unified_diff.rb index 69fdaa6fd..7649ed653 100644 --- a/lib/redmine/unified_diff.rb +++ b/lib/redmine/unified_diff.rb @@ -124,6 +124,9 @@ module Redmine # remove leading a/ b/ @file_name = arg.sub(%r{^(a|b)/}, '') end + when "Subversion" + # removing trailing "(revision nn)" + @file_name = arg.sub(%r{\t+\(.*\)$}, '') else @file_name = arg end diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index 42e4863c5..52352a816 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -315,8 +315,8 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase get :diff, :id => PRJ_ID, :rev => 3, :type => dt assert_response :success assert_template 'diff' - assert_tag :tag => 'h2', - :content => / 3/ + assert_select 'h2', :text => /Revision 3/ + assert_select 'th.filename', :text => 'subversion_test/textfile.txt' end end