Vote #65332
完了CVS: Repository path encoding of non UTF-8 characters
0%
説明
We have some "ISO-8859-1" encoded filenames in our CVS repository. Repository.find(20).fetch_updates yields this error:
ActiveRecord::StatementInvalid (PGError: ERROR: invalid byte sequence for encoding "UTF8": 0xf3706961
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
: SELECT "changes".* FROM "changes" INNER JOIN changesets ON changes.changeset_id = changesets.id WHERE ("changes"."revision" = E'1.2' AND "changes"."path" = E'/xxxxx/AlterarSenha (c
...
The attached patch solved the problem for us.
Above is the relevant stack:
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in log'
execute'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:503:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:1000:in select_raw'
select'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:987:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in select_all_without_query_cache'
select_all'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:81:in cache_sql'
select_all'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:in find_by_sql'
find_every'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1490:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1452:in find_initial'
find'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:587:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1812:in find_by_path_and_revision'
send'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_collection.rb:370:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_collection.rb:370:in method_missing'
with_scope'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2003:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:202:in send'
with_scope'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:202:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_collection.rb:366:in method_missing'
fetch_changesets'
/app/models/repository/cvs.rb:107:in
/lib/redmine/scm/adapters/cvs_adapter.rb:192:in revisions'
each_line'
/lib/redmine/scm/adapters/cvs_adapter.rb:126:in
/lib/redmine/scm/adapters/cvs_adapter.rb:126:in revisions'
call'
/lib/redmine/scm/adapters/abstract_adapter.rb:181:in
/lib/redmine/scm/adapters/abstract_adapter.rb:181:in shellout'
popen'
/lib/redmine/scm/adapters/abstract_adapter.rb:179:in
/lib/redmine/scm/adapters/abstract_adapter.rb:179:in shellout'
shellout'
/lib/redmine/scm/adapters/abstract_adapter.rb:165:in
/lib/redmine/scm/adapters/cvs_adapter.rb:114:in revisions'
fetch_changesets'
/app/models/repository/cvs.rb:104:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:550:in transaction'
transaction'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:129:in
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:138:in transaction'
fetch_changesets'
/app/models/repository/cvs.rb:102:in
journals
--------------------------------------------------------------------------------
Ruby 1.9 compatibility is very serious.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
I finished implementing in r5465.
I can not prepare test repository for same reason with filesystem repository #2274.
If tar ball has Latin-1 path encoding files, I can't extract it on my Japanese Windows.
There are same limitations with git #5251.
--------------------------------------------------------------------------------
related_issues
relates,Closed,2664,Mercurial: Repository path encoding of non UTF-8 characters