Compare commits
18 Commits
2.3.3
...
2.3-stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ce399b0fb | ||
|
|
e143f01e84 | ||
|
|
75e90593e0 | ||
|
|
daf2d54f27 | ||
|
|
8849727bd9 | ||
|
|
c4eb7c380e | ||
|
|
4deca5976e | ||
|
|
8a046027e5 | ||
|
|
711a8aa09b | ||
|
|
7ec18933e0 | ||
|
|
0a25ee385f | ||
|
|
79f90dfba5 | ||
|
|
2b53422d1d | ||
|
|
77ad962132 | ||
|
|
7bfb4759e7 | ||
|
|
9d3377c92c | ||
|
|
55a1869b86 | ||
|
|
bcae879091 |
5
Gemfile
5
Gemfile
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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: 合计
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
BIN
test/fixtures/repositories/bazaar_repository.tar.gz
vendored
BIN
test/fixtures/repositories/bazaar_repository.tar.gz
vendored
Binary file not shown.
@@ -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 &" 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user