assert_equal false, br_latin_1_path.is_default
br_master = brs[4]
assert_equal 'master', br_master.to_s
- assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', br_master.revision
+ assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', br_master.revision
assert_equal br_master.scmid, br_master.revision
assert_equal false, br_master.is_default
br_master_20120212 = brs[5]
assert_equal 'master-20120212', br_master_20120212.to_s
- assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', br_master_20120212.revision
+ assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', br_master_20120212.revision
assert_equal br_master_20120212.scmid, br_master_20120212.revision
assert_equal true, br_master_20120212.is_default
br_latin_1 = brs[-2]
@adapter.revisions('', nil, "master", {}) do |rev|
revs1 << rev
end
- assert_equal 15, revs1.length
- assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', revs1[0].identifier
+ assert_equal 16, revs1.length
+ assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', revs1[0].identifier
assert_equal '7234cb2750b63f47bff735edc50a1c0a433c2518', revs1[-1].identifier
revs2 = []
{:reverse => true}) do |rev|
revs2 << rev
end
- assert_equal 15, revs2.length
- assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', revs2[-1].identifier
+ assert_equal 16, revs2.length
+ assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', revs2[-1].identifier
assert_equal '7234cb2750b63f47bff735edc50a1c0a433c2518', revs2[0].identifier
end
{:reverse => true}) do |rev|
revs1 << rev
end
- assert_equal 8, revs1.length
+ assert_equal 9, revs1.length
assert_equal 'fba357b886984ee71185ad2065e65fc0417d9b92', revs1[0].identifier
assert_equal '7e61ac704deecde634b51e59daa8110435dcb3da', revs1[1].identifier
# 4a07fe31b is not a child of 713f49446
assert_equal '4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8', revs1[2].identifier
# Merged revision
assert_equal '32ae898b720c2f7eec2723d5bdd558b4cb2d3ddf', revs1[3].identifier
- assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', revs1[-1].identifier
+ assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', revs1[-1].identifier
revs2 = []
@adapter.revisions('',
{:reverse => true}) do |rev|
revs2 << rev
end
- assert_equal 7, revs2.length
+ assert_equal 8, revs2.length
assert_equal '7e61ac704deecde634b51e59daa8110435dcb3da', revs2[0].identifier
# 4a07fe31b is not a child of fba357b8869
assert_equal '4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8', revs2[1].identifier
# Merged revision
assert_equal '32ae898b720c2f7eec2723d5bdd558b4cb2d3ddf', revs2[2].identifier
- assert_equal '83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', revs2[-1].identifier
+ assert_equal 'b1650eac7c505a6dab9f19858afc9ecb481eccc2', revs2[-1].identifier
end
def test_revisions_branch_latin_1_path_encoding_all
{:reverse => true}) do |rev|
revs1 << rev
end
- assert_equal 15, revs1.length
+ assert_equal 16, revs1.length
assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518",
revs1[0].identifier
assert_nil revs1[0].parents
require_relative '../test_helper'
class RepositoryGitTest < ActiveSupport::TestCase
- fixtures :projects, :repositories, :enabled_modules, :users, :roles
+ fixtures :projects, :repositories, :enabled_modules, :users, :roles, :changesets
include Redmine::I18n
REPOSITORY_UTF8_PATH = Rails.root.join('tmp/test/git_utf8_repository').to_s
REPOSITORY_UTF8_PATH.tr!('/', "\\") if Redmine::Platform.mswin?
- NUM_REV = 28
+ NUM_REV = 29
NUM_HEAD = 8
def setup
@project.reload
assert_equal NUM_REV, @repository.changesets.count
- assert_equal 39, @repository.filechanges.count
+ assert_equal 40, @repository.filechanges.count
commit = @repository.changesets.find_by_revision("7234cb2750b63f47bff735edc50a1c0a433c2518")
assert_equal "7234cb2750b63f47bff735edc50a1c0a433c2518", commit.scmid
assert_equal NUM_REV, @repository.changesets.count
extra_info_heads = @repository.extra_info["heads"].dup
assert_equal NUM_HEAD, extra_info_heads.size
- extra_info_heads.delete_if {|x| x == "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c"}
+ extra_info_heads.delete_if {|x| x == "b1650eac7c505a6dab9f19858afc9ecb481eccc2"}
assert_equal NUM_HEAD - 2, extra_info_heads.size
del_revs =
[
+ "b1650eac7c505a6dab9f19858afc9ecb481eccc2",
"83ca5fd546063a3c7dc2e568ba3355661a9e2b2c",
"ed5bb786bbda2dee66a2d50faf51429dbc043a7b",
"4f26664364207fa8b1af9f8722647ab2d4ac5d43",
end
@project.reload
cs1 = @repository.changesets
- assert_equal NUM_REV - 6, cs1.count
+ assert_equal NUM_REV - del_revs.size, cs1.count
extra_info_heads << "4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8"
h = {}
h["heads"] = extra_info_heads
@project.reload
assert_equal NUM_REV, @repository.changesets.count
assert_equal NUM_HEAD, @repository.extra_info["heads"].size
- assert @repository.extra_info["heads"].index("83ca5fd546063a3c7dc2e568ba3355661a9e2b2c")
+ assert @repository.extra_info["heads"].index("b1650eac7c505a6dab9f19858afc9ecb481eccc2")
end
def test_fetch_changesets_history_editing
assert_equal NUM_REV, @repository.changesets.count
extra_info_heads = @repository.extra_info["heads"].dup
assert_equal NUM_HEAD, extra_info_heads.size
- extra_info_heads.delete_if {|x| x == "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c"}
+ extra_info_heads.delete_if {|x| x == "b1650eac7c505a6dab9f19858afc9ecb481eccc2"}
assert_equal NUM_HEAD - 2, extra_info_heads.size
del_revs =
[
+ "b1650eac7c505a6dab9f19858afc9ecb481eccc2",
"83ca5fd546063a3c7dc2e568ba3355661a9e2b2c",
"ed5bb786bbda2dee66a2d50faf51429dbc043a7b",
"4f26664364207fa8b1af9f8722647ab2d4ac5d43",
rev.destroy if del_revs.detect {|r| r == rev.scmid.to_s}
end
@project.reload
- assert_equal NUM_REV - 6, @repository.changesets.count
+ assert_equal NUM_REV - del_revs.size, @repository.changesets.count
c = Changeset.new(:repository => @repository,
:committed_on => Time.now,
:comments => 'test')
assert c.save
@project.reload
- assert_equal NUM_REV - 5, @repository.changesets.count
+ assert_equal NUM_REV - del_revs.size + 1, @repository.changesets.count
extra_info_heads << "1234abcd5678"
h = {}
@repository.fetch_changesets
@project.reload
- assert_equal NUM_REV - 5, @repository.changesets.count
+ assert_equal NUM_REV - del_revs.size + 1, @repository.changesets.count
h2 = @repository.extra_info["heads"].dup
assert_equal h1, h2
end
assert_equal 0, @repository.extra_info["db_consistent"]["ordering"]
extra_info_heads = @repository.extra_info["heads"].dup
- extra_info_heads.delete_if {|x| x == "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c"}
+ extra_info_heads.delete_if {|x| x == "b1650eac7c505a6dab9f19858afc9ecb481eccc2"}
del_revs =
[
+ "b1650eac7c505a6dab9f19858afc9ecb481eccc2",
"83ca5fd546063a3c7dc2e568ba3355661a9e2b2c",
"ed5bb786bbda2dee66a2d50faf51429dbc043a7b",
"4f26664364207fa8b1af9f8722647ab2d4ac5d43",
end
@project.reload
cs1 = @repository.changesets
- assert_equal NUM_REV - 6, cs1.count
+ assert_equal NUM_REV - del_revs.size, cs1.count
assert_equal 0, @repository.extra_info["db_consistent"]["ordering"]
extra_info_heads << "4a07fe31bffcf2888791f3e6cbc9c4545cefe3e8"