mercurial: work around faulty parsing of early command options (#27516)

Use -sVALUE and --long=VALUE instead of "-s VALUE" and "--long VALUE"
respectively.

Contributed by Yuya Nishihara.

git-svn-id: http://svn.redmine.org/redmine/trunk@17062 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2017-12-07 11:38:47 +00:00
parent 58ed865513
commit 9d797400ea
2 changed files with 20 additions and 19 deletions

View File

@@ -21,6 +21,7 @@ class MercurialAdapterTest < ActiveSupport::TestCase
HELPERS_DIR = Redmine::Scm::Adapters::MercurialAdapter::HELPERS_DIR
TEMPLATE_NAME = Redmine::Scm::Adapters::MercurialAdapter::TEMPLATE_NAME
TEMPLATE_EXTENSION = Redmine::Scm::Adapters::MercurialAdapter::TEMPLATE_EXTENSION
HgCommandAborted = Redmine::Scm::Adapters::MercurialAdapter::HgCommandAborted
HgCommandArgumentError = Redmine::Scm::Adapters::MercurialAdapter::HgCommandArgumentError
REPOSITORY_PATH = repository_path('mercurial')
@@ -445,19 +446,18 @@ class MercurialAdapterTest < ActiveSupport::TestCase
end
def test_bad_early_options
assert_raise HgCommandArgumentError do
@adapter.diff('sources/welcome_controller.rb', '--config=alias.rhdiff=!xterm')
end
assert_nil @adapter.diff('sources/welcome_controller.rb',
'--config=alias.rhdiff=!xterm')
assert_raise HgCommandArgumentError do
@adapter.entries('--debugger')
end
assert_raise HgCommandArgumentError do
assert_raise HgCommandAborted do
@adapter.revisions(nil, nil, nil, limit: '--repo=otherrepo')
end
assert_raise HgCommandArgumentError do
assert_raise HgCommandAborted do
@adapter.nodes_in_branch('default', limit: '--repository=otherrepo')
end
assert_raise HgCommandArgumentError do
assert_raise HgCommandAborted do
@adapter.nodes_in_branch('-Rotherrepo')
end
end