scm: mercurial: add Mercurial helper extension (#4455).

* 'rhsummary' and 'rhmanifest' for reducing the number of hg command calls.
* 'rhdiff' for compatibility with Mercurial < 1.1.

Also renamed TEMPLATES_DIR to HELPERS_DIR because the directory now contains
templates and a helper extension.

Original version was written by Alessio Franceschelli,
downloaded from http://www.redmine.org/attachments/3395/overhaul.py

Contributed by Alessio Franceschelli and Yuya Nishihara.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4833 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2011-02-15 11:04:30 +00:00
parent 2afc8e8c95
commit 2547e57168
3 changed files with 172 additions and 4 deletions
@@ -4,7 +4,7 @@ begin
class MercurialAdapterTest < ActiveSupport::TestCase
TEMPLATES_DIR = Redmine::Scm::Adapters::MercurialAdapter::TEMPLATES_DIR
HELPERS_DIR = Redmine::Scm::Adapters::MercurialAdapter::HELPERS_DIR
TEMPLATE_NAME = Redmine::Scm::Adapters::MercurialAdapter::TEMPLATE_NAME
TEMPLATE_EXTENSION = Redmine::Scm::Adapters::MercurialAdapter::TEMPLATE_EXTENSION
@@ -149,7 +149,7 @@ begin
end
def test_template_path_for(version, template)
assert_equal "#{TEMPLATES_DIR}/#{TEMPLATE_NAME}-#{template}.#{TEMPLATE_EXTENSION}",
assert_equal "#{HELPERS_DIR}/#{TEMPLATE_NAME}-#{template}.#{TEMPLATE_EXTENSION}",
@adapter.class.template_path_for(version)
assert File.exist?(@adapter.class.template_path_for(version))
end