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
This commit is contained in:
Toshi MARUYAMA 2011-04-15 07:16:48 +00:00
parent 991d39a9ac
commit c84d2e6699
1 changed files with 6 additions and 4 deletions

View File

@ -150,11 +150,13 @@ module Redmine
# in the repository. both identifier have to be dates or nil. # in the repository. both identifier have to be dates or nil.
# these method returns nothing but yield every result in block # these method returns nothing but yield every result in block
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}, &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 "<cvs> revisions path:" + logger.debug "<cvs> revisions path:" +
"'#{path}',identifier_from #{identifier_from}, identifier_to #{identifier_to}" "'#{path}',identifier_from #{identifier_from}, identifier_to #{identifier_to}"
cmd_args = %w|-q rlog| cmd_args = %w|-q rlog|
cmd_args << "-d" << ">#{time_to_cvstime_rlog(identifier_from)}" if identifier_from 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| scm_cmd(*cmd_args) do |io|
state = "entry_start" state = "entry_start"
commit_log = String.new commit_log = String.new
@ -173,7 +175,7 @@ module Redmine
end end
if state == "entry_start" if state == "entry_start"
branch_map = Hash.new 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_path = normalize_cvs_path($1)
entry_name = normalize_path(File.basename($1)) entry_name = normalize_path(File.basename($1))
logger.debug("Path #{entry_path} <=> Name #{entry_name}") logger.debug("Path #{entry_path} <=> Name #{entry_name}")
@ -219,8 +221,8 @@ module Redmine
:paths => [{ :paths => [{
:revision => revision, :revision => revision,
:branch => revBranch, :branch => revBranch,
:path => entry_path, :path => scm_iconv('UTF-8', @path_encoding, entry_path),
:name => entry_name, :name => scm_iconv('UTF-8', @path_encoding, entry_name),
:kind => 'file', :kind => 'file',
:action => file_state :action => file_state
}] }]