Defect #3462
closedCVS: Repository path encoding of non UTF-8 characters
0%
Description
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<F3>pia).png') AND (("changesets".repository_id = 20)) LIMIT 1):
...
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'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:503:in `execute'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:1000:in `select_raw'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:987:in `select'
/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'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:81:in `cache_sql'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:in `find_by_sql'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1490:in `find_every'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1452:in `find_initial'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:587:in `find'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1812:in `find_by_path_and_revision'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_collection.rb:370:in `send'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_collection.rb:370:in `method_missing'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:2003:in `with_scope'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:202:in `send'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_proxy.rb:202:in `with_scope'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/associations/association_collection.rb:366:in `method_missing'
/app/models/repository/cvs.rb:107:in `fetch_changesets'
/lib/redmine/scm/adapters/cvs_adapter.rb:192:in `revisions'
/lib/redmine/scm/adapters/cvs_adapter.rb:126:in `each_line'
/lib/redmine/scm/adapters/cvs_adapter.rb:126:in `revisions'
/lib/redmine/scm/adapters/abstract_adapter.rb:181:in `call'
/lib/redmine/scm/adapters/abstract_adapter.rb:181:in `shellout'
/lib/redmine/scm/adapters/abstract_adapter.rb:179:in `popen'
/lib/redmine/scm/adapters/abstract_adapter.rb:179:in `shellout'
/lib/redmine/scm/adapters/abstract_adapter.rb:165:in `shellout'
/lib/redmine/scm/adapters/cvs_adapter.rb:114:in `revisions'
/app/models/repository/cvs.rb:104:in `fetch_changesets'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/postgresql_adapter.rb:550:in `transaction'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:129:in `transaction'
/opt/redmine/.gem/ruby/1.8/gems/activerecord-2.2.2/lib/active_record/transactions.rb:138:in `transaction'
/app/models/repository/cvs.rb:102:in `fetch_changesets'
Files
Related issues