Project

General

Profile

Mercurial support and encoding...

Added by Jérémie Delaitre about 15 years ago

Hi,

I have created project and tried to attach a mercurial repository to it.
When I run : ruby script/runner "Repository.fetch_changesets" -e production
I got the following error:

/home/redmine/redmine-0.8.0/vendor/rails/railties/lib/commands/runner.rb:47: /home/redmine/redmine-0.8.0/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:147:in `log': RuntimeError: ERROR        C22021  Minvalid byte sequence for encoding "UTF8": 0xe97365    HThis error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".        Fwchar.c        L1545   Rreport_invalid_encoding: INSERT INTO "changes" ("changeset_id", "action", "revision", "branch", "from_path", "path", "from_revision") VALUES(781, E'A', NULL, NULL, NULL, E'/Quantity/doc/Présentation du projet.pdf', NULL) RETURNING "id" (ActiveRecord::StatementInvalid)
        from /home/redmine/redmine-0.8.0/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:484:in `execute'
        from /home/redmine/redmine-0.8.0/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:929:in `select_raw'
        from /home/redmine/redmine-0.8.0/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:916:in `select'
        from /home/redmine/redmine-0.8.0/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'
        from /home/redmine/redmine-0.8.0/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:61:in `select_all'
        from /home/redmine/redmine-0.8.0/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:13:in `select_one'
        from /home/redmine/redmine-0.8.0/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:19:in `select_value'
        from /home/redmine/redmine-0.8.0/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:433:in `insert'
         ... 31 levels...
        from /home/redmine/redmine-0.8.0/vendor/rails/railties/lib/commands/runner.rb:47
        from /home/redmine/apps/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from /home/redmine/apps/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from script/runner:3

I have search the forum and tickets and others had similar errors and all seems ok since we can choose repositories encoding in the settings.
But...not for me !

I have tried various encoding combination without success like:

Repositories encodings: ISO-8859-15,ISO-8859-1,UTF-8
Commit messages encoding: ISO-8859-15

I have tried to change return Iconv.conv('UTF-8', encoding, str) to return Iconv.conv('UTF-8//IGNORE', encoding, str) in app/models/changeset.rb without success too (Do I need to run something to take this modification into account ?).

I am completly lost indeed.

Moreover, fetching changesets takes 15 minutes for my local mercurial repository (106 changesets) while a SVN repository (850+ changesets) accessed through a network takes 15 seconds ! Is that ok ?

Here is my config:

About your application's environment
Ruby version 1.8.6 (i686-linux)
RubyGems version 1.3.1
Rails version 2.1.2

Thanks in advance and keep up the good work!


Replies (1)

RE: Mercurial support and encoding... - Added by Jérémie Delaitre about 15 years ago

After some investigation, I have created a new issue (#2664).

    (1-1/1)