scm: mercurial: update test repository for path contains space (#2664, #4455).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4997 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-03-04 08:07:53 +00:00
parent b7dffa44c9
commit 53249469a0
3 changed files with 17 additions and 13 deletions

View File

@ -58,8 +58,8 @@ begin
adp = Redmine::Scm::Adapters::MercurialAdapter.new(repo) adp = Redmine::Scm::Adapters::MercurialAdapter.new(repo)
repo_path = adp.info.root_url.gsub(/\\/, "/") repo_path = adp.info.root_url.gsub(/\\/, "/")
assert_equal REPOSITORY_PATH, repo_path assert_equal REPOSITORY_PATH, repo_path
assert_equal '24', adp.info.lastrev.revision assert_equal '26', adp.info.lastrev.revision
assert_equal '4cddb4e45f52',adp.info.lastrev.scmid assert_equal '3ae45e2d177d',adp.info.lastrev.scmid
end end
end end
@ -241,18 +241,22 @@ begin
end end
def test_branches def test_branches
assert_equal ['default', @branch_char_1, assert_equal [
'test_branch.latin-1', 'branch (1)[2]&,%.-3_4', 'test-branch-00'], 'default',
@adapter.branches 'branch (1)[2]&,%.-3_4',
@branch_char_1,
'test_branch.latin-1',
'test-branch-00',
], @adapter.branches
end end
def test_branchmap def test_branchmap
bm = { bm = {
'default' => '4cddb4e45f52', 'default' => '3ae45e2d177d',
@branch_char_1 => 'c8d3e4887474',
'test_branch.latin-1' => 'c2ffe7da686a', 'test_branch.latin-1' => 'c2ffe7da686a',
'branch (1)[2]&,%.-3_4' => '933ca60293d7', 'branch (1)[2]&,%.-3_4' => 'afc61e85bde7',
'test-branch-00' => '3a330eb32958' 'test-branch-00' => '3a330eb32958',
@branch_char_1 => 'c8d3e4887474',
} }
assert_equal bm, @adapter.branchmap assert_equal bm, @adapter.branchmap
end end

View File

@ -37,8 +37,8 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
def test_fetch_changesets_from_scratch def test_fetch_changesets_from_scratch
@repository.fetch_changesets @repository.fetch_changesets
@repository.reload @repository.reload
assert_equal 25, @repository.changesets.count assert_equal 27, @repository.changesets.count
assert_equal 32, @repository.changes.count assert_equal 34, @repository.changes.count
assert_equal "Initial import.\nThe repository contains 3 files.", assert_equal "Initial import.\nThe repository contains 3 files.",
@repository.changesets.find_by_revision('0').comments @repository.changesets.find_by_revision('0').comments
end end
@ -51,7 +51,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
assert_equal 3, @repository.changesets.count assert_equal 3, @repository.changesets.count
@repository.fetch_changesets @repository.fetch_changesets
assert_equal 25, @repository.changesets.count assert_equal 27, @repository.changesets.count
end end
def test_isodatesec def test_isodatesec
@ -174,7 +174,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
@repository.fetch_changesets @repository.fetch_changesets
@repository.reload @repository.reload
changesets = @repository.latest_changesets('README', nil) changesets = @repository.latest_changesets('README', nil)
assert_equal %w|17 8 6 1 0|, changesets.collect(&:revision) assert_equal %w|26 17 8 6 1 0|, changesets.collect(&:revision)
path = 'sql_escape/percent%dir/percent%file1.txt' path = 'sql_escape/percent%dir/percent%file1.txt'
changesets = @repository.latest_changesets(path, nil) changesets = @repository.latest_changesets(path, nil)