mirror of
https://github.com/redmine/redmine.git
synced 2025-11-12 08:16:03 +01:00
scm: mercurial: add double quote branch and tag name to test repository (#27790)
git-svn-id: http://svn.redmine.org/redmine/trunk@19766 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
BIN
test/fixtures/repositories/mercurial_repository.hg
vendored
BIN
test/fixtures/repositories/mercurial_repository.hg
vendored
Binary file not shown.
@@ -27,7 +27,7 @@ class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
|
|||||||
|
|
||||||
REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
|
REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
|
||||||
PRJ_ID = 3
|
PRJ_ID = 3
|
||||||
NUM_REV = 36
|
NUM_REV = 40
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ class MercurialAdapterTest < ActiveSupport::TestCase
|
|||||||
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 '35', adp.info.lastrev.revision
|
assert_equal '39', adp.info.lastrev.revision
|
||||||
assert_equal '3e998343166a1b8273973bcd46dd2bad74344d74',adp.info.lastrev.scmid
|
assert_equal '04aed9840e9266e535f5f20f7e42c9f9f84f9cf4',adp.info.lastrev.scmid
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -326,11 +326,13 @@ class MercurialAdapterTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_tags
|
def test_tags
|
||||||
assert_equal [@tag_char_1, 'tag_test.00', 'tag-init-revision'], @adapter.tags
|
tags = ['double"quote"tag', @tag_char_1, 'tag_test.00', 'tag-init-revision']
|
||||||
|
assert_equal tags, @adapter.tags
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_tagmap
|
def test_tagmap
|
||||||
tm = {
|
tm = {
|
||||||
|
'double"quote"tag' => 'cf5f7c556f5a643e1ec7cb01775be539f64eeefb',
|
||||||
@tag_char_1 => 'adf805632193500ad3b615cd04f58f9b0769f576',
|
@tag_char_1 => 'adf805632193500ad3b615cd04f58f9b0769f576',
|
||||||
'tag_test.00' => '6987191f453a5f6557018d522feea2c450d5588d',
|
'tag_test.00' => '6987191f453a5f6557018d522feea2c450d5588d',
|
||||||
'tag-init-revision' => '0885933ad4f68d77c2649cd11f8311276e7ef7ce',
|
'tag-init-revision' => '0885933ad4f68d77c2649cd11f8311276e7ef7ce',
|
||||||
@@ -343,7 +345,12 @@ class MercurialAdapterTest < ActiveSupport::TestCase
|
|||||||
@adapter.branches.each do |b|
|
@adapter.branches.each do |b|
|
||||||
branches << b
|
branches << b
|
||||||
end
|
end
|
||||||
assert_equal 8, branches.length
|
assert_equal 9, branches.length
|
||||||
|
|
||||||
|
branch = branches[-9]
|
||||||
|
assert_equal 'double"quote"branch', branch.to_s
|
||||||
|
assert_equal '39', branch.revision
|
||||||
|
assert_equal '04aed9840e9266e535f5f20f7e42c9f9f84f9cf4', branch.scmid
|
||||||
|
|
||||||
branch = branches[-8]
|
branch = branches[-8]
|
||||||
assert_equal 'issue-23055-ctrl-char', branch.to_s
|
assert_equal 'issue-23055-ctrl-char', branch.to_s
|
||||||
@@ -388,6 +395,7 @@ class MercurialAdapterTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
def test_branchmap
|
def test_branchmap
|
||||||
bm = {
|
bm = {
|
||||||
|
'double"quote"branch' => '04aed9840e9266e535f5f20f7e42c9f9f84f9cf4',
|
||||||
'issue-23055-ctrl-char' => '3e998343166a1b8273973bcd46dd2bad74344d74',
|
'issue-23055-ctrl-char' => '3e998343166a1b8273973bcd46dd2bad74344d74',
|
||||||
'default' => '31eeee7395c8c78e66dd54c50addd078d10b2355',
|
'default' => '31eeee7395c8c78e66dd54c50addd078d10b2355',
|
||||||
'test_branch.latin-1' => 'c2ffe7da686aa3d956e59f2a2854cf8980a8b768',
|
'test_branch.latin-1' => 'c2ffe7da686aa3d956e59f2a2854cf8980a8b768',
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
|
|||||||
include Redmine::I18n
|
include Redmine::I18n
|
||||||
|
|
||||||
REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
|
REPOSITORY_PATH = Rails.root.join('tmp/test/mercurial_repository').to_s
|
||||||
NUM_REV = 36
|
NUM_REV = 40
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
User.current = nil
|
User.current = nil
|
||||||
@@ -167,7 +167,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
|
|||||||
@repository.fetch_changesets
|
@repository.fetch_changesets
|
||||||
@project.reload
|
@project.reload
|
||||||
assert_equal NUM_REV, @repository.changesets.count
|
assert_equal NUM_REV, @repository.changesets.count
|
||||||
assert_equal 48, @repository.filechanges.count
|
assert_equal 51, @repository.filechanges.count
|
||||||
rev0 = @repository.changesets.find_by_revision('0')
|
rev0 = @repository.changesets.find_by_revision('0')
|
||||||
assert_equal "Initial import.\nThe repository contains 3 files.",
|
assert_equal "Initial import.\nThe repository contains 3 files.",
|
||||||
rev0.comments
|
rev0.comments
|
||||||
@@ -590,7 +590,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
|
|||||||
@repository.fetch_changesets
|
@repository.fetch_changesets
|
||||||
@project.reload
|
@project.reload
|
||||||
assert_equal NUM_REV, @repository.changesets.count
|
assert_equal NUM_REV, @repository.changesets.count
|
||||||
[(NUM_REV - 1).to_s, "3e998343166a", "3e998"].each do |r1|
|
[(NUM_REV - 1).to_s, "04aed9840e92", "04aed"].each do |r1|
|
||||||
changeset = @repository.find_changeset_by_name(r1)
|
changeset = @repository.find_changeset_by_name(r1)
|
||||||
assert_nil changeset.next
|
assert_nil changeset.next
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user