diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-03-04 04:25:48 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-03-04 04:25:48 +0000 |
commit | b7dffa44c92ce7a18f13504d5ad3f7b4d79ce57d (patch) | |
tree | 7f388f3b87a8ebecee8df4c24cc092917a2f7eff /test/unit/repository_mercurial_test.rb | |
parent | 32e69dcaca6cb62ad974936ecd3f38f93d7329a1 (diff) | |
download | redmine-b7dffa44c92ce7a18f13504d5ad3f7b4d79ce57d.tar.gz redmine-b7dffa44c92ce7a18f13504d5ad3f7b4d79ce57d.zip |
scm: mercurial: update test repository for path encoding (#2664).
Mercurial (and also Git) treats file names as byte string.
This mercurial test repository contains Latin-1 encoding path.
Be careful on non Latin-1(CP1252) Windows.
If your Windows is not Latin-1 Windows,
in order to checkout(update) Latin-1 path,
You need to use cygwin 1.7 and set LANG=en_US.ISO-8859-1.
Please refer.
http://mercurial.selenic.com/wiki/EncodingStrategy?action=recall&rev=6
Redmine mercurial adapter do not need to checkout(update) repository.
Mercurial does not have "bare" repository such as Git.
You can use "hg update null" for equivalent "bare" repository.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4996 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/repository_mercurial_test.rb')
-rw-r--r-- | test/unit/repository_mercurial_test.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index 271ffe43b..9c3032bf3 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -25,7 +25,11 @@ class RepositoryMercurialTest < ActiveSupport::TestCase def setup @project = Project.find(3) - @repository = Repository::Mercurial.create(:project => @project, :url => REPOSITORY_PATH) + @repository = Repository::Mercurial.create( + :project => @project, + :url => REPOSITORY_PATH, + :path_encoding => 'ISO-8859-1' + ) assert @repository end @@ -33,8 +37,8 @@ class RepositoryMercurialTest < ActiveSupport::TestCase def test_fetch_changesets_from_scratch @repository.fetch_changesets @repository.reload - assert_equal 17, @repository.changesets.count - assert_equal 25, @repository.changes.count + assert_equal 25, @repository.changesets.count + assert_equal 32, @repository.changes.count assert_equal "Initial import.\nThe repository contains 3 files.", @repository.changesets.find_by_revision('0').comments end @@ -47,7 +51,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase assert_equal 3, @repository.changesets.count @repository.fetch_changesets - assert_equal 17, @repository.changesets.count + assert_equal 25, @repository.changesets.count end def test_isodatesec @@ -170,7 +174,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase @repository.fetch_changesets @repository.reload changesets = @repository.latest_changesets('README', nil) - assert_equal %w|8 6 1 0|, changesets.collect(&:revision) + assert_equal %w|17 8 6 1 0|, changesets.collect(&:revision) path = 'sql_escape/percent%dir/percent%file1.txt' changesets = @repository.latest_changesets(path, nil) |