@@ -130,17 +130,14 class RepositoryGitTest < ActiveSupport::TestCase | |||||
130 | assert_equal NUM_REV, @repository.changesets.count |
|
130 | assert_equal NUM_REV, @repository.changesets.count | |
131 | end |
|
131 | end | |
132 |
|
132 | |||
133 |
def test_fetch_changesets_ |
|
133 | def test_fetch_changesets_history_editing | |
134 | assert_equal 0, @repository.changesets.count |
|
134 | assert_equal 0, @repository.changesets.count | |
135 | @repository.fetch_changesets |
|
135 | @repository.fetch_changesets | |
136 | @project.reload |
|
136 | @project.reload | |
137 | assert_equal NUM_REV, @repository.changesets.count |
|
137 | assert_equal NUM_REV, @repository.changesets.count | |
138 |
|
|
138 | assert_equal 5, @repository.extra_info["branches"].size | |
139 | assert_equal 5, extra_info_db.size |
|
|||
140 | assert_equal "1ca7f5ed374f3cb31a93ae5215c2e25cc6ec5127", |
|
|||
141 | extra_info_db["latin-1-path-encoding"]["last_scmid"] |
|
|||
142 | assert_equal "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c", |
|
139 | assert_equal "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c", | |
143 |
extra_info |
|
140 | @repository.extra_info["branches"]["master"]["last_scmid"] | |
144 |
|
141 | |||
145 | del_revs = [ |
|
142 | del_revs = [ | |
146 | "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c", |
|
143 | "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c", | |
@@ -154,21 +151,28 class RepositoryGitTest < ActiveSupport::TestCase | |||||
154 | rev.destroy if del_revs.detect {|r| r == rev.scmid.to_s } |
|
151 | rev.destroy if del_revs.detect {|r| r == rev.scmid.to_s } | |
155 | end |
|
152 | end | |
156 | @project.reload |
|
153 | @project.reload | |
157 |
|
|
154 | assert_equal NUM_REV - 6, @repository.changesets.count | |
158 | assert_equal 22, cs1.count |
|
155 | ||
|
156 | c = Changeset.new(:repository => @repository, | |||
|
157 | :committed_on => Time.now, | |||
|
158 | :revision => "abcd1234efgh", | |||
|
159 | :scmid => "abcd1234efgh", | |||
|
160 | :comments => 'test') | |||
|
161 | assert c.save | |||
|
162 | @project.reload | |||
|
163 | assert_equal NUM_REV - 5, @repository.changesets.count | |||
|
164 | ||||
159 | h = @repository.extra_info.dup |
|
165 | h = @repository.extra_info.dup | |
160 | h["branches"]["master"]["last_scmid"] = |
|
166 | h["branches"]["master"]["last_scmid"] = "abcd1234efgh" | |
161 | "abcd1234efgh" |
|
|||
162 | @repository.merge_extra_info(h) |
|
167 | @repository.merge_extra_info(h) | |
163 | @repository.save |
|
168 | @repository.save | |
164 | @project.reload |
|
169 | @project.reload | |
165 | extra_info_db_1 = @repository.extra_info["branches"] |
|
|||
166 | assert_equal "abcd1234efgh", |
|
170 | assert_equal "abcd1234efgh", | |
167 |
extra_info |
|
171 | @repository.extra_info["branches"]["master"]["last_scmid"] | |
168 |
|
172 | |||
169 | @repository.fetch_changesets |
|
173 | @repository.fetch_changesets | |
170 | @project.reload |
|
174 | @project.reload | |
171 |
assert_equal |
|
175 | assert_equal NUM_REV - 5, @repository.changesets.count | |
172 | end |
|
176 | end | |
173 |
|
177 | |||
174 | def test_parents |
|
178 | def test_parents |
General Comments 0
You need to be logged in to leave comments.
Login now