summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-01 10:27:30 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-01 10:27:30 +0000
commit5f5dec16f2ececf806404d497886e9cb5e454281 (patch)
treea7d7998ba8f8da7ac92ec0592ff6a13c52f4479b /app
parentc09b6edaf405754b969566b9da7d9284f80a34e6 (diff)
downloadredmine-5f5dec16f2ececf806404d497886e9cb5e454281.tar.gz
redmine-5f5dec16f2ececf806404d497886e9cb5e454281.zip
scm: add feature of per project repository log encoding setting (#1735).
Subversion, Mercurial and Git supports UTF-8 log. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4982 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/repositories_helper.rb12
-rw-r--r--app/models/repository.rb2
-rw-r--r--app/models/repository/bazaar.rb3
-rw-r--r--app/models/repository/cvs.rb3
-rw-r--r--app/models/repository/darcs.rb3
5 files changed, 16 insertions, 7 deletions
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
index e588fe366..1deb13cd9 100644
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -189,7 +189,9 @@ module RepositoriesHelper
def darcs_field_tags(form, repository)
content_tag('p', form.text_field(:url, :label => 'Root directory',
:size => 60, :required => true,
- :disabled => (repository && !repository.new_record?)))
+ :disabled => (repository && !repository.new_record?))) +
+ content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
+ :label => 'Commit messages encoding', :required => true))
end
def mercurial_field_tags(form, repository)
@@ -212,13 +214,17 @@ module RepositoriesHelper
:disabled => !repository.new_record?)) +
content_tag('p', form.text_field(:url, :label => 'Module',
:size => 30, :required => true,
- :disabled => !repository.new_record?))
+ :disabled => !repository.new_record?)) +
+ content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
+ :label => 'Commit messages encoding', :required => true))
end
def bazaar_field_tags(form, repository)
content_tag('p', form.text_field(:url, :label => 'Root directory',
:size => 60, :required => true,
- :disabled => (repository && !repository.new_record?)))
+ :disabled => (repository && !repository.new_record?))) +
+ content_tag('p', form.select(:log_encoding, [nil] + Setting::ENCODINGS,
+ :label => 'Commit messages encoding', :required => true))
end
def filesystem_field_tags(form, repository)
diff --git a/app/models/repository.rb b/app/models/repository.rb
index bddbbbec4..07e24af29 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -191,7 +191,7 @@ class Repository < ActiveRecord::Base
end
def repo_log_encoding
- encoding = Setting.commit_logs_encoding.to_s.strip
+ encoding = log_encoding.to_s.strip
encoding.blank? ? 'UTF-8' : encoding
end
diff --git a/app/models/repository/bazaar.rb b/app/models/repository/bazaar.rb
index d68fabc9a..3ae8b28fe 100644
--- a/app/models/repository/bazaar.rb
+++ b/app/models/repository/bazaar.rb
@@ -19,10 +19,11 @@ require 'redmine/scm/adapters/bazaar_adapter'
class Repository::Bazaar < Repository
attr_protected :root_url
- validates_presence_of :url
+ validates_presence_of :url, :log_encoding
ATTRIBUTE_KEY_NAMES = {
"url" => "Root directory",
+ "log_encoding" => "Commit messages encoding",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
diff --git a/app/models/repository/cvs.rb b/app/models/repository/cvs.rb
index e3dfced69..2ee82a740 100644
--- a/app/models/repository/cvs.rb
+++ b/app/models/repository/cvs.rb
@@ -19,11 +19,12 @@ require 'redmine/scm/adapters/cvs_adapter'
require 'digest/sha1'
class Repository::Cvs < Repository
- validates_presence_of :url, :root_url
+ validates_presence_of :url, :root_url, :log_encoding
ATTRIBUTE_KEY_NAMES = {
"url" => "CVSROOT",
"root_url" => "Module",
+ "log_encoding" => "Commit messages encoding",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super
diff --git a/app/models/repository/darcs.rb b/app/models/repository/darcs.rb
index c6d7cafd0..c8870e299 100644
--- a/app/models/repository/darcs.rb
+++ b/app/models/repository/darcs.rb
@@ -18,10 +18,11 @@
require 'redmine/scm/adapters/darcs_adapter'
class Repository::Darcs < Repository
- validates_presence_of :url
+ validates_presence_of :url, :log_encoding
ATTRIBUTE_KEY_NAMES = {
"url" => "Root directory",
+ "log_encoding" => "Commit messages encoding",
}
def self.human_attribute_name(attribute_key_name)
ATTRIBUTE_KEY_NAMES[attribute_key_name] || super