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
This commit is contained in:
1 parent
32e69dcaca
commit
b7dffa44c9
4 files changed
+41
-16
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user