##// END OF EJS Templates
scm: mercurial: update test repository (#5501)...
Toshi MARUYAMA -
r7542:476c3d54b711
parent child
Show More
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -28,7 +28,7 class RepositoriesMercurialControllerTest < ActionController::TestCase
28 REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
28 REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
29 CHAR_1_HEX = "\xc3\x9c"
29 CHAR_1_HEX = "\xc3\x9c"
30 PRJ_ID = 3
30 PRJ_ID = 3
31 NUM_REV = 29
31 NUM_REV = 32
32
32
33 ruby19_non_utf8_pass =
33 ruby19_non_utf8_pass =
34 (RUBY_VERSION >= '1.9' && Encoding.default_external.to_s != 'UTF-8')
34 (RUBY_VERSION >= '1.9' && Encoding.default_external.to_s != 'UTF-8')
@@ -72,8 +72,8 begin
72 adp = Redmine::Scm::Adapters::MercurialAdapter.new(repo)
72 adp = Redmine::Scm::Adapters::MercurialAdapter.new(repo)
73 repo_path = adp.info.root_url.gsub(/\\/, "/")
73 repo_path = adp.info.root_url.gsub(/\\/, "/")
74 assert_equal REPOSITORY_PATH, repo_path
74 assert_equal REPOSITORY_PATH, repo_path
75 assert_equal '28', adp.info.lastrev.revision
75 assert_equal '31', adp.info.lastrev.revision
76 assert_equal '3ae45e2d177d',adp.info.lastrev.scmid
76 assert_equal '31eeee7395c8',adp.info.lastrev.scmid
77 end
77 end
78 end
78 end
79
79
@@ -257,6 +257,7 begin
257 def test_branches
257 def test_branches
258 assert_equal [
258 assert_equal [
259 'default',
259 'default',
260 'test-branch-01',
260 @branch_char_1,
261 @branch_char_1,
261 'branch (1)[2]&,%.-3_4',
262 'branch (1)[2]&,%.-3_4',
262 @branch_char_0,
263 @branch_char_0,
@@ -267,10 +268,11 begin
267
268
268 def test_branchmap
269 def test_branchmap
269 bm = {
270 bm = {
270 'default' => '3ae45e2d177d',
271 'default' => '31eeee7395c8',
271 'test_branch.latin-1' => 'c2ffe7da686a',
272 'test_branch.latin-1' => 'c2ffe7da686a',
272 'branch (1)[2]&,%.-3_4' => 'afc61e85bde7',
273 'branch (1)[2]&,%.-3_4' => 'afc61e85bde7',
273 'test-branch-00' => '3a330eb32958',
274 'test-branch-00' => '3a330eb32958',
275 "test-branch-01" => 'ad4dc4f80284',
274 @branch_char_0 => 'c8d3e4887474',
276 @branch_char_0 => 'c8d3e4887474',
275 @branch_char_1 => '7bbf4c738e71',
277 @branch_char_1 => '7bbf4c738e71',
276 }
278 }
@@ -21,7 +21,7 class RepositoryMercurialTest < ActiveSupport::TestCase
21 fixtures :projects
21 fixtures :projects
22
22
23 REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
23 REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
24 NUM_REV = 29
24 NUM_REV = 32
25 CHAR_1_HEX = "\xc3\x9c"
25 CHAR_1_HEX = "\xc3\x9c"
26
26
27 if File.directory?(REPOSITORY_PATH)
27 if File.directory?(REPOSITORY_PATH)
@@ -56,7 +56,7 class RepositoryMercurialTest < ActiveSupport::TestCase
56 @repository.fetch_changesets
56 @repository.fetch_changesets
57 @project.reload
57 @project.reload
58 assert_equal NUM_REV, @repository.changesets.count
58 assert_equal NUM_REV, @repository.changesets.count
59 assert_equal 37, @repository.changes.count
59 assert_equal 46, @repository.changes.count
60 assert_equal "Initial import.\nThe repository contains 3 files.",
60 assert_equal "Initial import.\nThe repository contains 3 files.",
61 @repository.changesets.find_by_revision('0').comments
61 @repository.changesets.find_by_revision('0').comments
62 end
62 end
@@ -109,19 +109,19 class RepositoryMercurialTest < ActiveSupport::TestCase
109
109
110 # with_limit
110 # with_limit
111 changesets = @repository.latest_changesets('', nil, 2)
111 changesets = @repository.latest_changesets('', nil, 2)
112 assert_equal %w|28 27|, changesets.collect(&:revision)
112 assert_equal %w|31 30|, changesets.collect(&:revision)
113
113
114 # with_filepath
114 # with_filepath
115 changesets = @repository.latest_changesets(
115 changesets = @repository.latest_changesets(
116 '/sql_escape/percent%dir/percent%file1.txt', nil)
116 '/sql_escape/percent%dir/percent%file1.txt', nil)
117 assert_equal %w|11 10 9|, changesets.collect(&:revision)
117 assert_equal %w|30 11 10 9|, changesets.collect(&:revision)
118
118
119 changesets = @repository.latest_changesets(
119 changesets = @repository.latest_changesets(
120 '/sql_escape/underscore_dir/understrike_file.txt', nil)
120 '/sql_escape/underscore_dir/understrike_file.txt', nil)
121 assert_equal %w|12 9|, changesets.collect(&:revision)
121 assert_equal %w|30 12 9|, changesets.collect(&:revision)
122
122
123 changesets = @repository.latest_changesets('README', nil)
123 changesets = @repository.latest_changesets('README', nil)
124 assert_equal %w|28 17 8 6 1 0|, changesets.collect(&:revision)
124 assert_equal %w|31 30 28 17 8 6 1 0|, changesets.collect(&:revision)
125
125
126 changesets = @repository.latest_changesets('README','8')
126 changesets = @repository.latest_changesets('README','8')
127 assert_equal %w|8 6 1 0|, changesets.collect(&:revision)
127 assert_equal %w|8 6 1 0|, changesets.collect(&:revision)
@@ -135,7 +135,7 class RepositoryMercurialTest < ActiveSupport::TestCase
135
135
136 path = 'sql_escape/percent%dir'
136 path = 'sql_escape/percent%dir'
137 changesets = @repository.latest_changesets(path, nil)
137 changesets = @repository.latest_changesets(path, nil)
138 assert_equal %w|13 11 10 9|, changesets.collect(&:revision)
138 assert_equal %w|30 13 11 10 9|, changesets.collect(&:revision)
139
139
140 changesets = @repository.latest_changesets(path, '11')
140 changesets = @repository.latest_changesets(path, '11')
141 assert_equal %w|11 10 9|, changesets.collect(&:revision)
141 assert_equal %w|11 10 9|, changesets.collect(&:revision)
@@ -145,7 +145,7 class RepositoryMercurialTest < ActiveSupport::TestCase
145
145
146 path = 'sql_escape/underscore_dir'
146 path = 'sql_escape/underscore_dir'
147 changesets = @repository.latest_changesets(path, nil)
147 changesets = @repository.latest_changesets(path, nil)
148 assert_equal %w|13 12 9|, changesets.collect(&:revision)
148 assert_equal %w|30 13 12 9|, changesets.collect(&:revision)
149
149
150 changesets = @repository.latest_changesets(path, '12')
150 changesets = @repository.latest_changesets(path, '12')
151 assert_equal %w|12 9|, changesets.collect(&:revision)
151 assert_equal %w|12 9|, changesets.collect(&:revision)
@@ -312,7 +312,7 class RepositoryMercurialTest < ActiveSupport::TestCase
312 @repository.fetch_changesets
312 @repository.fetch_changesets
313 @project.reload
313 @project.reload
314 assert_equal NUM_REV, @repository.changesets.count
314 assert_equal NUM_REV, @repository.changesets.count
315 %w|28 3ae45e2d177d 3ae45|.each do |r1|
315 %w|31 31eeee7395c8 31eee|.each do |r1|
316 changeset = @repository.find_changeset_by_name(r1)
316 changeset = @repository.find_changeset_by_name(r1)
317 assert_nil changeset.next
317 assert_nil changeset.next
318 end
318 end
General Comments 0
You need to be logged in to leave comments. Login now