@@ -0,0 +1,23 | |||||
|
1 | module Redmine | |||
|
2 | module Scm | |||
|
3 | class Base | |||
|
4 | class << self | |||
|
5 | ||||
|
6 | def all | |||
|
7 | @scms | |||
|
8 | end | |||
|
9 | ||||
|
10 | # Add a new SCM adapter and repository | |||
|
11 | def add(scm_name) | |||
|
12 | @scms ||= [] | |||
|
13 | @scms << scm_name | |||
|
14 | end | |||
|
15 | ||||
|
16 | # Remove a SCM adapter from Redmine's list of supported scms | |||
|
17 | def delete(scm_name) | |||
|
18 | @scms.delete(scm_name) | |||
|
19 | end | |||
|
20 | end | |||
|
21 | end | |||
|
22 | end | |||
|
23 | end |
@@ -46,7 +46,7 class ApplicationController < ActionController::Base | |||||
46 | include Redmine::MenuManager::MenuController |
|
46 | include Redmine::MenuManager::MenuController | |
47 | helper Redmine::MenuManager::MenuHelper |
|
47 | helper Redmine::MenuManager::MenuHelper | |
48 |
|
48 | |||
49 | REDMINE_SUPPORTED_SCM.each do |scm| |
|
49 | Redmine::Scm::Base.all.each do |scm| | |
50 | require_dependency "repository/#{scm.underscore}" |
|
50 | require_dependency "repository/#{scm.underscore}" | |
51 | end |
|
51 | end | |
52 |
|
52 |
@@ -126,7 +126,7 module RepositoriesHelper | |||||
126 |
|
126 | |||
127 | def scm_select_tag(repository) |
|
127 | def scm_select_tag(repository) | |
128 | scm_options = [["--- #{l(:actionview_instancetag_blank_option)} ---", '']] |
|
128 | scm_options = [["--- #{l(:actionview_instancetag_blank_option)} ---", '']] | |
129 | REDMINE_SUPPORTED_SCM.each do |scm| |
|
129 | Redmine::Scm::Base.all.each do |scm| | |
130 | scm_options << ["Repository::#{scm}".constantize.scm_name, scm] if Setting.enabled_scm.include?(scm) || (repository && repository.class.name.demodulize == scm) |
|
130 | scm_options << ["Repository::#{scm}".constantize.scm_name, scm] if Setting.enabled_scm.include?(scm) || (repository && repository.class.name.demodulize == scm) | |
131 | end |
|
131 | end | |
132 |
|
132 |
@@ -13,7 +13,7 | |||||
13 | <%= link_to_function l(:label_generate_key), "if ($('settings_sys_api_key').disabled == false) { $('settings_sys_api_key').value = randomKey(20) }" %> |
|
13 | <%= link_to_function l(:label_generate_key), "if ($('settings_sys_api_key').disabled == false) { $('settings_sys_api_key').value = randomKey(20) }" %> | |
14 | </p> |
|
14 | </p> | |
15 |
|
15 | |||
16 |
<p><%= setting_multiselect(:enabled_scm, R |
|
16 | <p><%= setting_multiselect(:enabled_scm, Redmine::Scm::Base.all) %></p> | |
17 |
|
17 | |||
18 | <p><%= setting_text_field :repositories_encodings, :size => 60 %><br /> |
|
18 | <p><%= setting_text_field :repositories_encodings, :size => 60 %><br /> | |
19 | <em><%= l(:text_comma_separated) %></em></p> |
|
19 | <em><%= l(:text_comma_separated) %></em></p> |
@@ -7,6 +7,7 require 'redmine/themes' | |||||
7 | require 'redmine/hook' |
|
7 | require 'redmine/hook' | |
8 | require 'redmine/plugin' |
|
8 | require 'redmine/plugin' | |
9 | require 'redmine/wiki_formatting' |
|
9 | require 'redmine/wiki_formatting' | |
|
10 | require 'redmine/scm/base' | |||
10 |
|
11 | |||
11 | begin |
|
12 | begin | |
12 | require_library_or_gem 'RMagick' unless Object.const_defined?(:Magick) |
|
13 | require_library_or_gem 'RMagick' unless Object.const_defined?(:Magick) | |
@@ -21,7 +22,13 else | |||||
21 | FCSV = CSV |
|
22 | FCSV = CSV | |
22 | end |
|
23 | end | |
23 |
|
24 | |||
24 | REDMINE_SUPPORTED_SCM = %w( Subversion Darcs Mercurial Cvs Bazaar Git Filesystem ) |
|
25 | Redmine::Scm::Base.add "Subversion" | |
|
26 | Redmine::Scm::Base.add "Darcs" | |||
|
27 | Redmine::Scm::Base.add "Mercurial" | |||
|
28 | Redmine::Scm::Base.add "Cvs" | |||
|
29 | Redmine::Scm::Base.add "Bazaar" | |||
|
30 | Redmine::Scm::Base.add "Git" | |||
|
31 | Redmine::Scm::Base.add "Filesystem" | |||
25 |
|
32 | |||
26 | # Permissions |
|
33 | # Permissions | |
27 | Redmine::AccessControl.map do |map| |
|
34 | Redmine::AccessControl.map do |map| |
General Comments 0
You need to be logged in to leave comments.
Login now