Compare commits

..

1 Commits

Author SHA1 Message Date
Jean-Philippe Lang
071bc7bc46 tagged version 2.3.3
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/tags/2.3.3@12137 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-14 06:47:41 +00:00
15 changed files with 93 additions and 190 deletions

View File

@@ -14,7 +14,7 @@ end
# Optional gem for OpenID authentication
group :openid do
gem "ruby-openid", "~> 2.3.0", :require => "openid"
gem "ruby-openid", "~> 2.2.3", :require => "openid"
gem "rack-openid"
end
@@ -31,7 +31,7 @@ end
platforms :jruby do
# jruby-openssl is bundled with JRuby 1.7.0
gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERSION < '1.7.0'
gem "activerecord-jdbc-adapter", "~> 1.2.6"
gem "activerecord-jdbc-adapter", "1.2.5"
end
# Include database gems for the adapters found in the database
@@ -81,7 +81,6 @@ group :test do
gem "mocha", "~> 0.13.3"
gem 'capybara', '~> 2.0.0'
gem 'nokogiri', '< 1.6.0'
gem 'selenium-webdriver', '2.35.1'
end
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")

View File

@@ -102,7 +102,7 @@ class Attachment < ActiveRecord::Base
if @temp_file && (@temp_file.size > 0)
self.disk_directory = target_directory
self.disk_filename = Attachment.disk_filename(filename, disk_directory)
logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)") if logger
logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)")
path = File.dirname(diskfile)
unless File.directory?(path)
FileUtils.mkdir_p(path)

View File

@@ -106,10 +106,10 @@ class Issue < ActiveRecord::Base
when 'all'
nil
when 'default'
user_ids = [user.id] + user.groups.map(&:id).compact
user_ids = [user.id] + user.groups.map(&:id)
"(#{table_name}.is_private = #{connection.quoted_false} OR #{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
when 'own'
user_ids = [user.id] + user.groups.map(&:id).compact
user_ids = [user.id] + user.groups.map(&:id)
"(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
else
'1=0'

View File

@@ -19,18 +19,8 @@
<tr class="bloc-<%= revision.nil? ? 0 : colors[revision.identifier || revision.revision] %>">
<th class="line-num" id="L<%= line_num %>"><a href="#L<%= line_num %>"><%= line_num %></a></th>
<td class="revision">
<% if revision && revision != previous_revision %>
<%= revision.identifier ?
link_to_revision(revision, @repository) : format_revision(revision) %>
<% end %>
</td>
<td class="author">
<% if revision && revision != previous_revision %>
<% author = Redmine::CodesetUtil.to_utf8(revision.author.to_s,
@repository.repo_log_encoding) %>
<%= author.split('<').first %>
<% end %>
</td>
<%= (revision.identifier ? link_to_revision(revision, @repository) : format_revision(revision)) if revision && revision != previous_revision %></td>
<td class="author"><%= h(revision.author.to_s.split('<').first) if revision && revision != previous_revision %></td>
<td class="line-code"><pre><%= line.html_safe %></pre></td>
</tr>
<% line_num += 1; previous_revision = revision %>

View File

@@ -1045,8 +1045,8 @@
label_attribute_of_assigned_to: Assignee's %{name}
label_attribute_of_fixed_version: Target version's %{name}
label_copy_subtasks: Copy subtasks
label_copied_to: kopiert til
label_copied_from: kopiert fra
label_copied_to: copied to
label_copied_from: copied from
label_any_issues_in_project: any issues in project
label_any_issues_not_in_project: any issues not in project
field_private_notes: Private notes

View File

@@ -1075,18 +1075,19 @@ zh:
label_cross_project_hierarchy: 与项目继承层次共享
label_cross_project_system: 与所有项目共享
button_hide: 隐藏
setting_non_working_week_days: 非工作日
label_in_the_next_days: 在未来几天之内
label_in_the_past_days: 在过去几天之内
label_attribute_of_user: 用户是 %{name}
text_turning_multiple_off: 如果您停用多重值设定,重复的值将被移除,以使每个项目仅保留一个值
label_attribute_of_issue: 问题是 %{name}
permission_add_documents: 添加文档
permission_edit_documents: 编辑文档
permission_delete_documents: 删除文档
label_gantt_progress_line: 进度线
setting_jsonp_enabled: 启用JSONP支持
field_inherit_members: 继承父项目成员
field_closed_on: 结束日期
setting_default_projects_tracker_ids: 新建项目默认跟踪标签
setting_non_working_week_days: Non-working days
label_in_the_next_days: in the next
label_in_the_past_days: in the past
label_attribute_of_user: User's %{name}
text_turning_multiple_off: If you disable multiple values, multiple values will be
removed in order to preserve only one value per item.
label_attribute_of_issue: Issue's %{name}
permission_add_documents: Add documents
permission_edit_documents: Edit documents
permission_delete_documents: Delete documents
label_gantt_progress_line: Progress line
setting_jsonp_enabled: Enable JSONP support
field_inherit_members: Inherit members
field_closed_on: Closed
setting_default_projects_tracker_ids: Default trackers for new projects
label_total_time: 合计

View File

@@ -2431,7 +2431,7 @@ class TCPDF
out('1 0 obj');
out('<</Type /Pages');
kids='/Kids [';
0.upto(nb - 1) do |i|
0.upto(nb) do |i|
kids<<(3+2*i).to_s + ' 0 R ';
end
out(kids + ']');
@@ -3103,7 +3103,7 @@ class TCPDF
# is a stream object that contains the definition of the CMap
# (PDF Reference 1.3 chap. 5.9)
newobj();
out('<</Length 345>>')
out('<</Length 383>>');
out('stream');
out('/CIDInit /ProcSet findresource begin');
out('12 dict begin');

View File

@@ -333,7 +333,7 @@ module Redmine
def annotate(path, identifier=nil)
identifier = 'HEAD' if identifier.blank?
cmd_args = %w|blame --encoding=UTF-8|
cmd_args = %w|blame|
cmd_args << "-p" << identifier << "--" << scm_iconv(@path_encoding, 'UTF-8', path)
blame = Annotate.new
content = nil

View File

@@ -503,20 +503,10 @@ task :migrate_from_mantis => :environment do
# Make sure bugs can refer bugs in other projects
Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations'
old_notified_events = Setting.notified_events
old_password_min_length = Setting.password_min_length
begin
# Turn off email notifications temporarily
Setting.notified_events = []
Setting.password_min_length = 4
# Run the migration
MantisMigrate.establish_connection db_params
MantisMigrate.migrate
ensure
# Restore previous settings
Setting.notified_events = old_notified_events
Setting.password_min_length = old_password_min_length
end
# Turn off email notifications
Setting.notified_events = []
MantisMigrate.establish_connection db_params
MantisMigrate.migrate
end
end

View File

@@ -245,8 +245,8 @@ namespace :redmine do
if name_attr = TracSessionAttribute.find_by_sid_and_name(username, 'name')
name = name_attr.value
end
name =~ (/(\w+)(\s+\w+)?/)
fn = ($1 || "-").strip
name =~ (/(.*)(\s+\w+)?/)
fn = $1.strip
ln = ($2 || '-').strip
u = User.new :mail => mail.gsub(/[^-@a-z0-9\.]/i, '-'),
@@ -762,19 +762,10 @@ namespace :redmine do
prompt('Target project identifier') {|identifier| TracMigrate.target_project_identifier identifier}
puts
old_notified_events = Setting.notified_events
old_password_min_length = Setting.password_min_length
begin
# Turn off email notifications temporarily
Setting.notified_events = []
Setting.password_min_length = 4
# Run the migration
TracMigrate.migrate
ensure
# Restore previous settings
Setting.notified_events = old_notified_events
Setting.password_min_length = old_password_min_length
end
# Turn off email notifications
Setting.notified_events = []
TracMigrate.migrate
end
end

View File

@@ -23,23 +23,17 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
fixtures :projects, :users, :roles, :members, :member_roles,
:repositories, :enabled_modules
REPOSITORY_PATH = Rails.root.join('tmp/test/bazaar_repository').to_s
REPOSITORY_PATH_TRUNK = File.join(REPOSITORY_PATH, "trunk")
REPOSITORY_PATH = Rails.root.join('tmp/test/bazaar_repository/trunk').to_s
PRJ_ID = 3
CHAR_1_UTF8_HEX = "\xc3\x9c"
def setup
User.current = nil
@project = Project.find(PRJ_ID)
@repository = Repository::Bazaar.create(
:project => @project,
:url => REPOSITORY_PATH_TRUNK,
:url => REPOSITORY_PATH,
:log_encoding => 'UTF-8')
assert @repository
@char_1_utf8 = CHAR_1_UTF8_HEX.dup
if @char_1_utf8.respond_to?(:force_encoding)
@char_1_utf8.force_encoding('UTF-8')
end
end
if File.directory?(REPOSITORY_PATH)
@@ -143,68 +137,26 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
:path => repository_path_hash(['doc-mkdir.txt'])[:param]
assert_response :success
assert_template 'annotate'
assert_select "th.line-num", :text => '2' do
assert_select "+ td.revision" do
assert_select "a", :text => '3'
assert_select "+ td.author", :text => "jsmith@" do
assert_select "+ td",
:text => "Main purpose:"
end
end
end
end
def test_annotate_author_escaping
repository = Repository::Bazaar.create(
:project => @project,
:url => File.join(REPOSITORY_PATH, "author_escaping"),
:identifier => 'author_escaping',
:log_encoding => 'UTF-8')
assert repository
get :annotate, :id => PRJ_ID, :repository_id => 'author_escaping',
:path => repository_path_hash(['author-escaping-test.txt'])[:param]
assert_response :success
assert_template 'annotate'
assert_select "th.line-num", :text => '1' do
assert_select "+ td.revision" do
assert_select "a", :text => '2'
assert_select "+ td.author", :text => "test &amp;" do
assert_select "+ td",
:text => "author escaping test"
end
end
end
end
if REPOSITORY_PATH.respond_to?(:force_encoding)
def test_annotate_author_non_ascii
log_encoding = nil
if Encoding.locale_charmap == "UTF-8" ||
Encoding.locale_charmap == "ISO-8859-1"
log_encoding = Encoding.locale_charmap
end
unless log_encoding.nil?
repository = Repository::Bazaar.create(
:project => @project,
:url => File.join(REPOSITORY_PATH, "author_non_ascii"),
:identifier => 'author_non_ascii',
:log_encoding => log_encoding)
assert repository
get :annotate, :id => PRJ_ID, :repository_id => 'author_non_ascii',
:path => repository_path_hash(['author-non-ascii-test.txt'])[:param]
assert_response :success
assert_template 'annotate'
assert_select "th.line-num", :text => '1' do
assert_select "+ td.revision" do
assert_select "a", :text => '2'
assert_select "+ td.author", :text => "test #{@char_1_utf8}" do
assert_select "+ td",
:text => "author non ASCII test"
end
end
end
end
end
assert_tag :tag => 'th', :content => '2',
:sibling => {
:tag => 'td',
:child => {
:tag => 'a',
:content => '3'
}
}
assert_tag :tag => 'th', :content => '2',
:sibling => { :tag => 'td', :content => /jsmith/ }
assert_tag :tag => 'th', :content => '2',
:sibling => {
:tag => 'td',
:child => {
:tag => 'a',
:content => '3'
}
}
assert_tag :tag => 'th', :content => '2',
:sibling => { :tag => 'td', :content => /Main purpose/ }
end
def test_destroy_valid_repository

View File

@@ -27,7 +27,6 @@ class RepositoriesGitControllerTest < ActionController::TestCase
REPOSITORY_PATH.gsub!(/\//, "\\") if Redmine::Platform.mswin?
PRJ_ID = 3
CHAR_1_HEX = "\xc3\x9c"
FELIX_HEX = "Felix Sch\xC3\xA4fer"
NUM_REV = 28
## Git, Mercurial and CVS path encodings are binary.
@@ -51,10 +50,8 @@ class RepositoriesGitControllerTest < ActionController::TestCase
)
assert @repository
@char_1 = CHAR_1_HEX.dup
@felix_utf8 = FELIX_HEX.dup
if @char_1.respond_to?(:force_encoding)
@char_1.force_encoding('UTF-8')
@felix_utf8.force_encoding('UTF-8')
end
end
@@ -535,32 +532,11 @@ class RepositoriesGitControllerTest < ActionController::TestCase
get :annotate, :id => PRJ_ID,
:path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param],
:rev => r1
assert_select "th.line-num", :text => '1' do
assert_select "+ td.revision" do
assert_select "a", :text => '57ca437c'
assert_select "+ td.author", :text => "jsmith" do
assert_select "+ td",
:text => "test-#{@char_1}.txt"
end
end
end
end
end
end
end
def test_annotate_latin_1_author
['83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', '83ca5fd546063a'].each do |r1|
get :annotate, :id => PRJ_ID,
:path => repository_path_hash([" filename with a leading space.txt "])[:param],
:rev => r1
assert_select "th.line-num", :text => '1' do
assert_select "+ td.revision" do
assert_select "a", :text => '83ca5fd5'
assert_select "+ td.author", :text => @felix_utf8 do
assert_select "+ td",
:text => "And this is a file with a leading and trailing space..."
end
assert_tag :tag => 'th',
:content => '1',
:attributes => { :class => 'line-num' },
:sibling => { :tag => 'td',
:content => /test-#{@char_1}.txt/ }
end
end
end

View File

@@ -432,15 +432,30 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
:rev => r1
assert_response :success
assert_template 'annotate'
assert_select "th.line-num", :text => '1' do
assert_select "+ td.revision" do
assert_select "a", :text => '20:709858aafd1b'
assert_select "+ td.author", :text => "jsmith" do
assert_select "+ td",
:text => "Mercurial is a distributed version control system."
end
end
end
assert_tag :tag => 'th',
:content => '1',
:attributes => { :class => 'line-num' },
:sibling =>
{
:tag => 'td',
:attributes => { :class => 'revision' },
:child => { :tag => 'a', :content => '20:709858aafd1b' }
}
assert_tag :tag => 'th',
:content => '1',
:attributes => { :class => 'line-num' },
:sibling =>
{
:tag => 'td' ,
:content => 'jsmith' ,
:attributes => { :class => 'author' },
}
assert_tag :tag => 'th',
:content => '1',
:attributes => { :class => 'line-num' },
:sibling => { :tag => 'td',
:content => /Mercurial is a distributed version control system/ }
end
end

View File

@@ -61,10 +61,8 @@ begin
)
assert @adapter
@char_1 = CHAR_1_HEX.dup
@str_felix_hex = FELIX_HEX.dup
if @char_1.respond_to?(:force_encoding)
@char_1.force_encoding('UTF-8')
@str_felix_hex.force_encoding('ASCII-8BIT')
end
end
@@ -398,10 +396,14 @@ begin
def test_last_rev_with_spaces_in_filename
last_rev = @adapter.lastrev("filemane with spaces.txt",
"ed5bb786bbda2dee66a2d50faf51429dbc043a7b")
str_felix_hex = FELIX_HEX.dup
last_rev_author = last_rev.author
if last_rev_author.respond_to?(:force_encoding)
str_felix_hex.force_encoding('ASCII-8BIT')
end
assert_equal "ed5bb786bbda2dee66a2d50faf51429dbc043a7b", last_rev.scmid
assert_equal "ed5bb786bbda2dee66a2d50faf51429dbc043a7b", last_rev.identifier
assert_equal "#{@str_felix_hex} <felix@fachschaften.org>",
assert_equal "#{str_felix_hex} <felix@fachschaften.org>",
last_rev.author
assert_equal "2010-09-18 19:59:46".to_time, last_rev.time
end
@@ -424,19 +426,6 @@ begin
end
end
def test_latin_1_user_annotate
['83ca5fd546063a3c7dc2e568ba3355661a9e2b2c', '83ca5fd546063a'].each do |r1|
annotate = @adapter.annotate(" filename with a leading space.txt ", r1)
assert_kind_of Redmine::Scm::Adapters::Annotate, annotate
assert_equal 1, annotate.lines.size
assert_equal "And this is a file with a leading and trailing space...",
annotate.lines[0].strip
assert_equal "83ca5fd546063a3c7dc2e568ba3355661a9e2b2c",
annotate.revisions[0].identifier
assert_equal @str_felix_hex, annotate.revisions[0].author
end
end
def test_entries_tag
entries1 = @adapter.entries(nil, 'tag01.annotated',
options = {:report_last_commit => true})