Compare commits

..

18 Commits

Author SHA1 Message Date
Toshi MARUYAMA
5ce399b0fb Merged r12229 from trunk to 2.3-stable (#15185)
Simplified Chinese translation for 2.3-stable updated.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12233 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-10-24 06:35:11 +00:00
Toshi MARUYAMA
e143f01e84 2.3-stable: Gemfile: pin selenium-webdriver version 2.35.1.
selenium-webdriver requires rubyzip 1.0.0.
rubyzip 1.0.0 requires Ruby version >= 1.9.2.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12227 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-10-20 10:47:19 +00:00
Jean-Philippe Lang
75e90593e0 Merged r12202 (#14977).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12214 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-10-13 08:28:26 +00:00
Jean-Philippe Lang
daf2d54f27 Merged r12162 from trunk (#14902).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12213 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-10-13 08:27:02 +00:00
Jean-Philippe Lang
8849727bd9 Merged r12164 from trunk (#14592).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12212 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-10-13 08:26:18 +00:00
Jean-Philippe Lang
c4eb7c380e Merged r12163 from trunk (#14590, #14592).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12211 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-10-13 08:24:48 +00:00
Toshi MARUYAMA
4deca5976e Merged r12189 from trunk to 2.3-stable (#13632)
pdf: fix empty page attached when exporting.

Contributed by Jun NAITOH.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12191 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-30 12:22:26 +00:00
Toshi MARUYAMA
8a046027e5 Merged r12180 from trunk to 2.3-stable (#14886)
Norwegian translation updated by Lennart Nordgreen.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12183 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-30 06:20:47 +00:00
Toshi MARUYAMA
711a8aa09b Merged r12173 from trunk to 2.3-stable (#14919)
Gemfile: update ruby-openid version above 2.3.0.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12178 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-30 03:19:44 +00:00
Toshi MARUYAMA
7ec18933e0 Merged r12172 from trunk to 2.3-stable (#14883)
Gemfile: update jdbc adapter version above 1.2.6.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12174 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-30 00:36:44 +00:00
Toshi MARUYAMA
0a25ee385f Merged r12138, r12149, r12156 and r12157 from trunk to 2.3-stable (#14931)
scm: fix annotate error with non ASCII author on Ruby 1.9 and Ruby 2.0.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12160 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-19 03:53:31 +00:00
Toshi MARUYAMA
79f90dfba5 Merged r12143 from trunk to 2.3-stable (#14931)
scm: git: use "--encoding=UTF-8" for blame.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12159 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-19 03:25:38 +00:00
Toshi MARUYAMA
2b53422d1d Merged r12155 from trunk to 2.3-stable (#14931)
scm: bazaar: update test repository for non ASCII author.

* run "bzr branch --no-tree branch00 author_non_ascii"
* add revision to this branch

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12158 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-18 23:16:20 +00:00
Toshi MARUYAMA
77ad962132 Merged r12153 from trunk to 2.3-stable (#14931)
scm: git: fix indents of non ASCII path annotate test.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12154 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-18 13:26:32 +00:00
Toshi MARUYAMA
7bfb4759e7 Merged r12150 from trunk to 2.3-stable (#14931)
use assert_select instead of assert_tag in Git non ASCII path annotate test.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12152 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-18 13:03:49 +00:00
Toshi MARUYAMA
9d3377c92c Merged r12146, r12147 and r12148 from trunk to 2.3-stable (#14931)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12151 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-18 11:15:08 +00:00
Toshi MARUYAMA
55a1869b86 Merged r12142 from trunk to 2.3-stable (#14931)
scm: git: change non ASCII user name variable to instance variable.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12145 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-18 08:10:10 +00:00
Toshi MARUYAMA
bcae879091 Merged r12139, r12140 and r12141 from trunk to 2.3-stable (#14931)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12144 e93f8b46-1217-0410-a6f0-8f06a7374b81
2013-09-18 08:09:59 +00:00
15 changed files with 190 additions and 93 deletions

View File

@@ -14,7 +14,7 @@ end
# Optional gem for OpenID authentication
group :openid do
gem "ruby-openid", "~> 2.2.3", :require => "openid"
gem "ruby-openid", "~> 2.3.0", :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.5"
gem "activerecord-jdbc-adapter", "~> 1.2.6"
end
# Include database gems for the adapters found in the database
@@ -81,6 +81,7 @@ 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)")
logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)") if logger
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)
user_ids = [user.id] + user.groups.map(&:id).compact
"(#{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)
user_ids = [user.id] + user.groups.map(&:id).compact
"(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
else
'1=0'

View File

@@ -19,8 +19,18 @@
<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">
<%= (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>
<% 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>
<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: copied to
label_copied_from: copied from
label_copied_to: kopiert til
label_copied_from: kopiert fra
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,19 +1075,18 @@ zh:
label_cross_project_hierarchy: 与项目继承层次共享
label_cross_project_system: 与所有项目共享
button_hide: 隐藏
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
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: 新建项目默认跟踪标签
label_total_time: 合计

View File

@@ -2431,7 +2431,7 @@ class TCPDF
out('1 0 obj');
out('<</Type /Pages');
kids='/Kids [';
0.upto(nb) do |i|
0.upto(nb - 1) 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 383>>');
out('<</Length 345>>')
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|
cmd_args = %w|blame --encoding=UTF-8|
cmd_args << "-p" << identifier << "--" << scm_iconv(@path_encoding, 'UTF-8', path)
blame = Annotate.new
content = nil

View File

@@ -503,10 +503,20 @@ 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'
# Turn off email notifications
Setting.notified_events = []
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
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 =~ (/(.*)(\s+\w+)?/)
fn = $1.strip
name =~ (/(\w+)(\s+\w+)?/)
fn = ($1 || "-").strip
ln = ($2 || '-').strip
u = User.new :mail => mail.gsub(/[^-@a-z0-9\.]/i, '-'),
@@ -762,10 +762,19 @@ namespace :redmine do
prompt('Target project identifier') {|identifier| TracMigrate.target_project_identifier identifier}
puts
# Turn off email notifications
Setting.notified_events = []
TracMigrate.migrate
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
end
end

View File

@@ -23,17 +23,23 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
fixtures :projects, :users, :roles, :members, :member_roles,
:repositories, :enabled_modules
REPOSITORY_PATH = Rails.root.join('tmp/test/bazaar_repository/trunk').to_s
REPOSITORY_PATH = Rails.root.join('tmp/test/bazaar_repository').to_s
REPOSITORY_PATH_TRUNK = File.join(REPOSITORY_PATH, "trunk")
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,
:url => REPOSITORY_PATH_TRUNK,
: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)
@@ -137,26 +143,68 @@ class RepositoriesBazaarControllerTest < ActionController::TestCase
:path => repository_path_hash(['doc-mkdir.txt'])[:param]
assert_response :success
assert_template 'annotate'
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/ }
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
end
def test_destroy_valid_repository

View File

@@ -27,6 +27,7 @@ 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.
@@ -50,8 +51,10 @@ 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
@@ -532,11 +535,32 @@ class RepositoriesGitControllerTest < ActionController::TestCase
get :annotate, :id => PRJ_ID,
:path => repository_path_hash(['latin-1-dir', "test-#{@char_1}.txt"])[:param],
:rev => r1
assert_tag :tag => 'th',
:content => '1',
:attributes => { :class => 'line-num' },
:sibling => { :tag => 'td',
:content => /test-#{@char_1}.txt/ }
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
end
end
end

View File

@@ -432,30 +432,15 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
:rev => r1
assert_response :success
assert_template 'annotate'
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/ }
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
end
end

View File

@@ -61,8 +61,10 @@ 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
@@ -396,14 +398,10 @@ 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
@@ -426,6 +424,19 @@ 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})