diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-02-23 07:04:32 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-02-23 07:04:32 +0000 |
commit | f8da0127f7d798046c4d40adc1fb8895a00594c6 (patch) | |
tree | 526d0fa4e16e95cc79af33527ef1fad37e4e7966 | |
parent | 494c2b50078f901bffa9c99bfcea90d48e722c07 (diff) | |
download | redmine-f8da0127f7d798046c4d40adc1fb8895a00594c6.tar.gz redmine-f8da0127f7d798046c4d40adc1fb8895a00594c6.zip |
scm: mercurial: annotate path encoding support in adapter (#2664).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4931 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | lib/redmine/scm/adapters/mercurial_adapter.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb index 683a5731f..9b12dd383 100644 --- a/lib/redmine/scm/adapters/mercurial_adapter.rb +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb @@ -238,9 +238,11 @@ module Redmine end def annotate(path, identifier=nil) + p = CGI.escape(scm_iconv(@path_encoding, 'UTF-8', path)) blame = Annotate.new - hg 'annotate', '-ncu', '-r', hgrev(identifier), hgtarget(path) do |io| + hg 'rhannotate', '-ncu', '-r', hgrev(identifier), hgtarget(p) do |io| io.each_line do |line| + line.force_encoding('ASCII-8BIT') if line.respond_to?(:force_encoding) next unless line =~ %r{^([^:]+)\s(\d+)\s([0-9a-f]+):\s(.*)$} r = Revision.new(:author => $1.strip, :revision => $2, :scmid => $3, :identifier => $3) |