From c84d2e669919c936afb9a830926cbd676d75ecdc Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 15 Apr 2011 07:16:48 +0000 Subject: [PATCH] scm: cvs: convert encoding paths in revisions() of adapter (#3462). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5463 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/scm/adapters/cvs_adapter.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/redmine/scm/adapters/cvs_adapter.rb b/lib/redmine/scm/adapters/cvs_adapter.rb index 73a1c2c3b..32de489e0 100644 --- a/lib/redmine/scm/adapters/cvs_adapter.rb +++ b/lib/redmine/scm/adapters/cvs_adapter.rb @@ -150,11 +150,13 @@ module Redmine # in the repository. both identifier have to be dates or nil. # these method returns nothing but yield every result in block def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}, &block) + path_with_project_utf8 = path_with_proj(path) + path_with_project_locale = scm_iconv(@path_encoding, 'UTF-8', path_with_project_utf8) logger.debug " revisions path:" + "'#{path}',identifier_from #{identifier_from}, identifier_to #{identifier_to}" cmd_args = %w|-q rlog| cmd_args << "-d" << ">#{time_to_cvstime_rlog(identifier_from)}" if identifier_from - cmd_args << path_with_proj(path) + cmd_args << path_with_project_utf8 scm_cmd(*cmd_args) do |io| state = "entry_start" commit_log = String.new @@ -173,7 +175,7 @@ module Redmine end if state == "entry_start" branch_map = Hash.new - if /^RCS file: #{Regexp.escape(root_url_path)}\/#{Regexp.escape(path_with_proj(path))}(.+),v$/ =~ line + if /^RCS file: #{Regexp.escape(root_url_path)}\/#{Regexp.escape(path_with_project_locale)}(.+),v$/ =~ line entry_path = normalize_cvs_path($1) entry_name = normalize_path(File.basename($1)) logger.debug("Path #{entry_path} <=> Name #{entry_name}") @@ -219,8 +221,8 @@ module Redmine :paths => [{ :revision => revision, :branch => revBranch, - :path => entry_path, - :name => entry_name, + :path => scm_iconv('UTF-8', @path_encoding, entry_path), + :name => scm_iconv('UTF-8', @path_encoding, entry_name), :kind => 'file', :action => file_state }]