Project

General

Profile

Actions

Defect #5408

closed

Mercurial and chinese code

Added by xiaoyu yin over 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
SCM
Target version:
-
Start date:
2010-04-30
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

当HG库的路径中有中文目录,或者文件有中文名称时,中文显示为乱码,如图.

When the way to repository include some chinese code, there's some problem with it to show the way or the name of files.

!!


Files

hg-template-1.0.tmpl (825 Bytes) hg-template-1.0.tmpl xiaoyu yin, 2010-04-30 10:25
mercurial_adapter_当前_.rb (7.94 KB) mercurial_adapter_当前_.rb xiaoyu yin, 2010-04-30 10:25
hg-chinese-problem.bmp (147 KB) hg-chinese-problem.bmp xiaoyu yin, 2010-04-30 10:25
redmine-windows-japanese-sjis.png (7.99 KB) redmine-windows-japanese-sjis.png Toshi MARUYAMA, 2010-05-04 21:21
redmine-windows-japanese-sjis-setting.png (10.5 KB) redmine-windows-japanese-sjis-setting.png Toshi MARUYAMA, 2010-05-04 21:21
explorer-windows-japanese-sjis.png (9.21 KB) explorer-windows-japanese-sjis.png Toshi MARUYAMA, 2010-05-04 21:21
tortoisehg-windows-japanese-sjis-1.png (39.2 KB) tortoisehg-windows-japanese-sjis-1.png Toshi MARUYAMA, 2010-05-04 21:42
problem_cut_01.bmp (264 KB) problem_cut_01.bmp xiaoyu yin, 2010-05-05 09:33
problem_cut_02.bmp (387 KB) problem_cut_02.bmp xiaoyu yin, 2010-05-05 09:33
database.yml (1.09 KB) database.yml xiaoyu yin, 2010-05-10 07:43
Japanese-Windows-set-env.png (19.2 KB) Japanese-Windows-set-env.png Toshi MARUYAMA, 2010-05-11 03:58
环境变量-中文.bmp (480 KB) 环境变量-中文.bmp xiaoyu yin, 2010-05-11 04:49
japanese-windows-set-env-ruby.png (17.5 KB) japanese-windows-set-env-ruby.png Toshi MARUYAMA, 2010-05-11 05:42
migrate_result.txt (2.07 KB) migrate_result.txt migrate successfully,but no option was added. xiaoyu yin, 2010-06-08 09:30

Related issues

Has duplicate Redmine - Defect #5407: 当HG库的路径中有中文目录,或者文件有中文名称时,中文显示为乱码,如图.When there is chinese Closed2010-04-30

Actions
Is duplicate of Redmine - Defect #2664: Mercurial: Repository path encoding of non UTF-8 charactersClosedToshi MARUYAMA2009-02-04

Actions
Actions #1

Updated by Jean-Philippe Lang over 14 years ago

  • Subject changed from 当HG库的路径中有中文目录,或者文件有中文名称时,中文显示为乱码,如图.When there is chinese to Mercurial and chinese code

Please post in english and include patches rather than source files so we can see what you changed.

Actions #2

Updated by Toshi MARUYAMA over 14 years ago

Try #2664 patch.

Actions #3

Updated by xiaoyu yin over 14 years ago

Thank you fist! I have tried the Settings -> Repository setting to set the code of repository, but it doesn't solve the problem.

I have tried the #2664 patch and it doesn't solve the problem too.

My configure:
BitNami Redmine Stack
(
- Redmine 0.9.3
- Apache 2.2.14
- ImageMagick 6.5.6-8-Q8
- MySQL 5.0.83
- Subversion 1.6.6
- Ruby 1.8.7
- Rails 2.3.5
- RubyGems 1.3.5
)
tortoisehg-1.0.1-hg-1.5.1-x86(= mercurial 1.5.1)

system: Windows Xp professional 2002 SP3

Actions #4

Updated by Toshi MARUYAMA over 14 years ago

Thank you for your feedback.
I have tried on Japanese Windows Vista and SQLite.
I can see Japanese named file.
You need to delete repository created before patch applied and recreate the same repository from Redmine settings tab.

Actions #5

Updated by Toshi MARUYAMA over 14 years ago

Please delete "tortoisehg-windows-japanese-sjis.png" because this image contains mail address.
Now I post a new image "tortoisehg-windows-japanese-sjis-1.png".

Actions #6

Updated by Felix Schäfer over 14 years ago

  • File deleted (tortoisehg-windows-japanese-sjis.png)
Actions #7

Updated by xiaoyu yin over 14 years ago

Dose the issue-2664-0.9-stable-2010-04-11.patch will add an 'repository path encoding Options' in the repository tab settings of redmine ? or I need to set the 'repository encoding Options' in the repository tab settings of redmine to UTF-8 ?

I Modified my source file as the issue-2664-0.9-stable-2010-04-11.patch told, but there's nothing changed.

And I have tried to delete repository and recreate by redmine, but there's nothing changed.

By the way , my hg's language setting is English for redmine doesn't Identification chinese hg. When I changed hg to English language, the redmine works.

You can see from picture that the commit message and author in chinese are all correct except the chinese path.

Actions #8

Updated by Toshi MARUYAMA over 14 years ago

You need to run "patch" command with -p1 option on redmine directory and run "rake db:migrate" .

$ hg clone -U http://bitbucket.org/svn/redmine
$ cd redmine
$ hg update -r 0.9-stable
$ wget http://www.redmine.org/attachments/download/3544/issue-2664-0.9-stable-2010-04-11.patch
$ patch -p1 < issue-2664-0.9-stable-2010-04-11.patch 
patching file lib/redmine/scm/adapters/mercurial/hg-template-0.9.5.tmpl
patching file lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl
patching file lib/redmine/scm/adapters/mercurial_adapter.rb
patching file app/helpers/repositories_helper.rb
patching file app/models/repository.rb
patching file db/migrate/20100410053957_add_repositories_path_encoding.rb
patching file lib/redmine/scm/adapters/path_encodable_wrapper.rb
$ hg status
M app/helpers/repositories_helper.rb
M app/models/repository.rb
M lib/redmine/scm/adapters/mercurial/hg-template-0.9.5.tmpl
M lib/redmine/scm/adapters/mercurial/hg-template-1.0.tmpl
M lib/redmine/scm/adapters/mercurial_adapter.rb
? db/migrate/20100410053957_add_repositories_path_encoding.rb
? issue-2664-0.9-stable-2010-04-11.patch
? lib/redmine/scm/adapters/path_encodable_wrapper.rb
$ rake db:migrate RAILS_ENV=XXXX
Actions #9

Updated by Toshi MARUYAMA over 14 years ago

You can use "hg import" instead of "patch" command.

$ hg pare
changeset:   3718:50156ae18af6
branch:      0.9-stable
tag:         tip
parent:      3713:661ffe81dfdd
user:        jplang@e93f8b46-1217-0410-a6f0-8f06a7374b81
date:        Mon May 03 16:21:37 2010 +0000
summary:     tagged version 0.9.4

$ hg import issue-2664-0.9-stable-2010-04-11.patch
applying issue-2664-0.9-stable-2010-04-11.patch
applied fb5f1869fb60

$ hg glog -l3
@  changeset:   3720:4d0e8db09b44
|  branch:      0.9-stable
|  tag:         tip
|  user:        Yuya Nishihara <XXXXXXXXXXXXXXX>
|  date:        Sun Apr 11 11:17:38 2010 +0900
|  summary:     repository: add filename encoding conversion
|
o  changeset:   3719:fb5f1869fb60
|  branch:      0.9-stable
|  user:        Yuya Nishihara <XXXXXXXXXXXXXXX>
|  date:        Sun Apr 11 11:17:43 2010 +0900
|  summary:     mercurial: escape any filenames by urlescape
|
o  changeset:   3718:50156ae18af6
|  branch:      0.9-stable
|  parent:      3713:661ffe81dfdd
|  user:        jplang@e93f8b46-1217-0410-a6f0-8f06a7374b81
|  date:        Mon May 03 16:21:37 2010 +0000
|  summary:     tagged version 0.9.4
|

Actions #10

Updated by xiaoyu yin over 14 years ago

I can't run the 'rake' command .

Actions #11

Updated by Toshi MARUYAMA over 14 years ago

xiaoyu yin wrote:

I can't run the 'rake' command .

$ gem install rake
Actions #12

Updated by xiaoyu yin over 14 years ago

  • Status changed from New to Resolved

Thank you! But I can't run the command too.

Actions #13

Updated by Toshi MARUYAMA over 14 years ago

I don't know what BitNami is.
"hg clone" is an example of source install.
You need rename config/database.yml.example to config/database.yml.

$ rake db:migrate RAILS_ENV=test_sqlite3
(in R:/REDMINE/bitbucket-redmine-qclone/redmine-mq)
Loaded suite r:/Ruby/bin/rake
Started

Finished in 0.001 seconds.

0 tests, 0 assertions, 0 failures, 0 errors
$ rake db:migrate RAILS_ENV=XXXX
(in R:/REDMINE/bitbucket-redmine-qclone/redmine-mq)
rake aborted!
No such file or directory - R:/REDMINE/bitbucket-redmine-qclone/redmine-mq/config/environments/XXXX.rb

(See full trace by running task with --trace)
Actions #14

Updated by xiaoyu yin over 14 years ago

Thank you very much .

Here is the explain of BitNami:http://bitnami.org/learn_more

my database.yml exits.

Actions #15

Updated by Toshi MARUYAMA over 14 years ago

Set PATH to your ruby.exe installed path.

set PATH=%PATH%;R:\Ruby\bin

You can use control panel too.

R:\Ruby\bin>dir

2010/03/23  12:24    <DIR>          .
2010/03/23  12:24    <DIR>          ..
2010/02/10  12:34               419 convert_to_should_syntax
2010/02/10  12:34               170 convert_to_should_syntax.bat
2009/11/10  04:00            48,640 dbm3.dll
2009/11/10  04:00             3,880 erb
2009/11/10  04:00               177 erb.bat
2009/11/10  04:00            62,464 gdbm3.dll
2009/11/10  04:01               571 gem
2009/11/10  04:01               177 gem.bat
2009/11/10  04:00               377 irb
2009/11/10  04:00               177 irb.bat
2009/11/10  04:00         1,568,177 libeay32-0.9.8-msvcrt.dll
2009/11/10  04:00           978,432 libiconv2.dll
2009/11/10  03:56           839,680 msvcrt-ruby18.dll
2009/11/10  04:00           114,688 pdcurses.dll
2010/01/18  21:56               392 rackup
2010/01/18  21:56               152 rackup.bat
2010/03/23  12:24               394 rails
2010/03/23  12:24               151 rails.bat
2010/01/18  21:56               390 rake
2010/01/18  21:56               150 rake.bat
2009/11/10  04:00             1,541 rdoc
2009/11/10  04:00               177 rdoc.bat
2009/11/10  04:00             1,489 ri
2009/11/10  04:00               177 ri.bat
2009/11/10  04:00           422,583 ruby.exe
2009/11/10  04:00           422,583 rubyw.exe
2009/09/12  09:53               312 setrbvars.bat
2009/11/10  04:00           329,215 ssleay32-0.9.8-msvcrt.dll
2009/11/10  04:00               151 testrb
2009/11/10  04:00               177 testrb.bat
2009/11/10  04:00            59,904 zlib1.dll
Actions #16

Updated by xiaoyu yin over 14 years ago

Maybe I can use the Bitnami's control panel?

like the annex

Actions #18

Updated by xiaoyu yin over 14 years ago

I've already set this to chinese by adding a system Environment_variable LANGUAGE zh_CN.

and I can't use the rake command in ruby/bin directory too.

Actions #19

Updated by Toshi MARUYAMA over 14 years ago

c:\>set PATH
Path=r:\Ruby\bin;C:\Program Files\TortoiseHg;C:\strawberry\c\bin;C:\strawberry\perl\bin;R:\PostgreSQL\8.4\bin;R:\PostgreSQL\8.4\lib;R:\PHP\;...
Actions #21

Updated by xiaoyu yin over 14 years ago

Sorry for so long time to test it.
I have run migrate command successfully, but the option doesn't been added.
I test it for several times, only once I can see the adition option but even this, there still shows error on chinese codes.

Actions #22

Updated by Toshi MARUYAMA over 14 years ago

I recommend you to manage redmine source with git or Mercurial.

Git repositry.
http://github.com/edavis10/redmine
Mercurial repository.
http://bitbucket.org/svn/redmine
Yuya's (patch author) MQ repository.
http://bitbucket.org/yuja/redmine-mq/src
http://bitbucket.org/yuja/redmine-mq-issue4455

Actions #23

Updated by Toshi MARUYAMA over 14 years ago

Redmine hg adapter has LANG problem #5117.
If Redmine runs as Windows service, you need to remove LANG env from system or apply #5117 patch. For TortoiseHg you can set user LANG env.

Actions #24

Updated by xiaoyu yin over 14 years ago

Oh, it's luckly today. I had to uninstall the redmine and reinstall it. Then creat hg repository in redmine folder.
And then import the patch. And then restart the redmine service. It works!! The path_encoding column was added successfully.

I repeat the steps above, it works too.

So, there's no error code now.

Thank you Toshi Maruyama! The problem solved.

Actions #25

Updated by Toshi MARUYAMA over 14 years ago

Please set this issue related to #2664.

Actions #26

Updated by xiaoyu yin over 14 years ago

Ok. Also, I run the "rake db:migrate RAILS_ENV=production" command. It's necessary.

Actions #27

Updated by Toshi MARUYAMA over 14 years ago

Xiaoyu, thanks for posting message at #2664.

Contributor, please set this issue related to #2664 because I don't have a right to set issue relation.

Actions #28

Updated by xiaoyu yin over 14 years ago

Issue #2664

Actions #29

Updated by xiaoyu yin over 14 years ago

How can I do it?

Actions #30

Updated by Toshi MARUYAMA over 14 years ago

xiaoyu yin wrote:

How can I do it?

You and I don't have a right to set issue relation on this Redmine.
For example, this issue is related to #5407 .

Actions #31

Updated by Eric Davis over 14 years ago

  • Priority changed from Urgent to Normal

I can't tell if this issue is resolved or not. Any else know what's going on here?

Actions #32

Updated by Toshi MARUYAMA over 14 years ago

Eric Davis wrote:

I can't tell if this issue is resolved or not. Any else know what's going on here?

This is duplicate with #2664.

Actions #33

Updated by Toshi MARUYAMA over 14 years ago

And this issue is related with #5251.

Actions #34

Updated by Toshi MARUYAMA almost 14 years ago

  • Status changed from Resolved to Closed
  • Resolution changed from Fixed to Duplicate
Actions

Also available in: Atom PDF