##// END OF EJS Templates
scm: cvs: convert author encoding with log encoding setting....
Toshi MARUYAMA -
r5336:04a22fa757a5
parent child
Show More
@@ -128,7 +128,7 class Repository::Cvs < Repository
128 fetch_since = latest_changeset ? latest_changeset.committed_on : nil
128 fetch_since = latest_changeset ? latest_changeset.committed_on : nil
129 transaction do
129 transaction do
130 tmp_rev_num = 1
130 tmp_rev_num = 1
131 scm.revisions('', fetch_since, nil, :with_paths => true) do |revision|
131 scm.revisions('', fetch_since, nil, :log_encoding => repo_log_encoding) do |revision|
132 # only add the change to the database, if it doen't exists. the cvs log
132 # only add the change to the database, if it doen't exists. the cvs log
133 # is not exclusive at all.
133 # is not exclusive at all.
134 tmp_time = revision.time.clone
134 tmp_time = revision.time.clone
@@ -239,9 +239,10 module Redmine
239 revision = $1
239 revision = $1
240 elsif /^date:\s+(\d+.\d+.\d+\s+\d+:\d+:\d+)/ =~ line
240 elsif /^date:\s+(\d+.\d+.\d+\s+\d+:\d+:\d+)/ =~ line
241 date = Time.parse($1)
241 date = Time.parse($1)
242 # TODO: This regexp fails in some non UTF-8 chars on Ruby 1.8.
242 line_utf8 = scm_iconv('UTF-8', options[:log_encoding], line)
243 author = /author: ([^;]+)/.match(line)[1]
243 author_utf8 = /author: ([^;]+)/.match(line_utf8)[1]
244 file_state = /state: ([^;]+)/.match(line)[1]
244 author = scm_iconv(options[:log_encoding], 'UTF-8', author_utf8)
245 file_state = /state: ([^;]+)/.match(line)[1]
245 # TODO:
246 # TODO:
246 # linechanges only available in CVS....
247 # linechanges only available in CVS....
247 # maybe a feature our SVN implementation.
248 # maybe a feature our SVN implementation.
@@ -24,7 +24,7 begin
24
24
25 def test_revisions_all
25 def test_revisions_all
26 cnt = 0
26 cnt = 0
27 @adapter.revisions('', nil, nil, :with_paths => true) do |revision|
27 @adapter.revisions('', nil, nil, :log_encoding => 'UTF-8') do |revision|
28 cnt += 1
28 cnt += 1
29 end
29 end
30 assert_equal 16, cnt
30 assert_equal 16, cnt
@@ -33,7 +33,7 begin
33 def test_revisions_from_rev3
33 def test_revisions_from_rev3
34 rev3_committed_on = Time.gm(2007, 12, 13, 16, 27, 22)
34 rev3_committed_on = Time.gm(2007, 12, 13, 16, 27, 22)
35 cnt = 0
35 cnt = 0
36 @adapter.revisions('', rev3_committed_on, nil, :with_paths => true) do |revision|
36 @adapter.revisions('', rev3_committed_on, nil, :log_encoding => 'UTF-8') do |revision|
37 cnt += 1
37 cnt += 1
38 end
38 end
39 assert_equal 4, cnt
39 assert_equal 4, cnt
General Comments 0
You need to be logged in to leave comments. Login now