Project

General

Profile

Actions

Defect #3462

closed

CVS: Repository path encoding of non UTF-8 characters

Added by Rodrigo Rosenfeld Rosas almost 15 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Low
Assignee:
Toshi MARUYAMA
Category:
SCM
Target version:
Start date:
2009-06-08
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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

cvs-path-encoding.patch (471 Bytes) cvs-path-encoding.patch Rodrigo Rosenfeld Rosas, 2009-06-08 16:24

Related issues

Related to Redmine - Defect #2664: Mercurial: Repository path encoding of non UTF-8 charactersClosedToshi MARUYAMA2009-02-04

Actions
Actions #1

Updated by Toshi MARUYAMA about 13 years ago

  • Assignee set to Toshi MARUYAMA
  • Priority changed from High to Normal
Actions #2

Updated by Toshi MARUYAMA about 13 years ago

  • Assignee deleted (Toshi MARUYAMA)
  • Priority changed from Normal to Low

Ruby 1.9 compatibility is very serious.

Actions #3

Updated by Toshi MARUYAMA about 13 years ago

  • Assignee set to Toshi MARUYAMA
Actions #4

Updated by Toshi MARUYAMA about 13 years ago

  • Subject changed from CVS path encoding problems to CVS: Repository path encoding of non UTF-8 characters
Actions #5

Updated by Toshi MARUYAMA about 13 years ago

  • Target version set to 1.2.0
Actions #6

Updated by Toshi MARUYAMA about 13 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

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.

Actions

Also available in: Atom PDF