Redmine 4.1.1

This commit is contained in:
Manuel Cillero 2020-11-22 21:20:06 +01:00
parent 33e7b881a5
commit 3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions

View file

@ -1,5 +1,7 @@
# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
# Copyright (C) 2006-2019 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -25,7 +27,6 @@ class MercurialAdapterTest < ActiveSupport::TestCase
HgCommandArgumentError = Redmine::Scm::Adapters::MercurialAdapter::HgCommandArgumentError
REPOSITORY_PATH = repository_path('mercurial')
CHAR_1_HEX = "\xc3\x9c"
if File.directory?(REPOSITORY_PATH)
def setup
@ -40,12 +41,12 @@ class MercurialAdapterTest < ActiveSupport::TestCase
nil,
nil,
nil,
'ISO-8859-1')
'ISO-8859-1')
@diff_c_support = true
@char_1 = CHAR_1_HEX.dup.force_encoding('UTF-8')
@tag_char_1 = "tag-#{CHAR_1_HEX}-00".force_encoding('UTF-8')
@branch_char_0 = "branch-#{CHAR_1_HEX}-00".force_encoding('UTF-8')
@branch_char_1 = "branch-#{CHAR_1_HEX}-01".force_encoding('UTF-8')
@char_1 = 'Ü'
@tag_char_1 = 'tag-Ü-00'
@branch_char_0 = 'branch-Ü-00'
@branch_char_1 = 'branch-Ü-01'
end
def test_hgversion
@ -79,7 +80,7 @@ class MercurialAdapterTest < ActiveSupport::TestCase
def test_info
[REPOSITORY_PATH, REPOSITORY_PATH + "/",
REPOSITORY_PATH + "//"].each do |repo|
REPOSITORY_PATH + "//"].each do |repo|
adp = Redmine::Scm::Adapters::MercurialAdapter.new(repo)
repo_path = adp.info.root_url.gsub(/\\/, "/")
assert_equal REPOSITORY_PATH, repo_path
@ -404,25 +405,26 @@ class MercurialAdapterTest < ActiveSupport::TestCase
@branch_char_0,
'test_branch.latin-1',
'test-branch-00',
].each do |bra|
nib0 = @adapter.nodes_in_branch(bra)
]
.each do |branch|
nib0 = @adapter.nodes_in_branch(branch)
assert nib0
nib1 = @adapter.nodes_in_branch(bra, :limit => 1)
nib1 = @adapter.nodes_in_branch(branch, :limit => 1)
assert_equal 1, nib1.size
case bra
when 'branch (1)[2]&,%.-3_4'
case branch
when 'branch (1)[2]&,%.-3_4'
if @adapter.class.client_version_above?([1, 6])
assert_equal 3, nib0.size
assert_equal 'afc61e85bde74de930e5846c8451bd55b5bafc9c', nib0[0]
nib2 = @adapter.nodes_in_branch(bra, :limit => 2)
nib2 = @adapter.nodes_in_branch(branch, :limit => 2)
assert_equal 2, nib2.size
assert_equal '933ca60293d78f7c7979dd123cc0c02431683575', nib2[1]
end
when @branch_char_1
when @branch_char_1
if @adapter.class.client_version_above?([1, 6])
assert_equal 2, nib0.size
assert_equal '08ff3227303ec0dfcc818efa8e9cc652fe81859f', nib0[1]
nib2 = @adapter.nodes_in_branch(bra, :limit => 1)
nib2 = @adapter.nodes_in_branch(branch, :limit => 1)
assert_equal 1, nib2.size
assert_equal '7bbf4c738e7145149d2e5eb1eed1d3a8ddd3b914', nib2[0]
end