scm: cvs: fix parsing revisions if author is not ASCII.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5455 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-04-14 15:01:55 +00:00
parent 7e5bc046d6
commit bebf8247a7
2 changed files with 2 additions and 3 deletions

View File

@ -252,8 +252,6 @@ class Changeset < ActiveRecord::Base
Changeset.to_utf8(str.to_s.strip, encoding)
end
private
def self.to_utf8(str, encoding)
return str if str.nil?
str.force_encoding("ASCII-8BIT") if str.respond_to?(:force_encoding)

View File

@ -137,11 +137,12 @@ class Repository::Cvs < Repository
revision.paths[0][:revision]
)
cmt = Changeset.normalize_comments(revision.message, repo_log_encoding)
author_utf8 = Changeset.to_utf8(revision.author, repo_log_encoding)
cs = changesets.find(
:first,
:conditions => {
:committed_on => tmp_time - time_delta .. tmp_time + time_delta,
:committer => revision.author,
:committer => author_utf8,
:comments => cmt
}
)