Feature #27831 » 27831-fixed.patch
| app/controllers/repositories_controller.rb | ||
|---|---|---|
|
before_action :find_project_repository, :except => [:new, :create, :edit, :update, :destroy, :committers]
|
||
|
before_action :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
|
||
|
before_action :authorize
|
||
|
accept_rss_auth :revisions
|
||
|
accept_rss_auth :revisions, :changes
|
||
|
rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed
|
||
| ... | ... | |
|
@entry = @repository.entry(@path, @rev)
|
||
|
(show_error_not_found; return) unless @entry
|
||
|
@changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i)
|
||
|
@properties = @repository.properties(@path, @rev)
|
||
|
@changeset = @repository.find_changeset_by_name(@rev)
|
||
|
respond_to do |format|
|
||
|
format.html do
|
||
|
@properties = @repository.properties(@path, @rev)
|
||
|
end
|
||
|
format.atom do
|
||
|
repo_text = @repository.identifier.presence || 'root'
|
||
|
rev_text = @changeset.nil? ? @rev : format_revision(@changeset)
|
||
|
render_feed(@changesets, :title => "#{@project.name}: #{repo_text} @ #{rev_text} - #{l(:label_change_plural)}")
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
def revisions
|
||
| app/views/repositories/changes.html.erb | ||
|---|---|---|
|
<% content_for :header_tags do %>
|
||
|
<%= stylesheet_link_tag "scm" %>
|
||
|
<%= auto_discovery_link_tag(
|
||
|
:atom,
|
||
|
:params => request.query_parameters.merge(:key => User.current.rss_key),
|
||
|
:format => 'atom') %>
|
||
|
<% end %>
|
||
|
<% other_formats_links do |f| %>
|
||
|
<%= f.link_to_with_query_parameters 'Atom', :key => User.current.rss_key %>
|
||
|
<% end %>
|
||
|
<% html_title(l(:label_change_plural)) -%>
|
||
| config/routes.rb | ||
|---|---|---|
|
:constraints => {:rev => /[a-z0-9\.\-_]+/, :path => /.*/}
|
||
|
end
|
||
|
get "projects/:id/repository/:repository_id/changes(/*path).:format",
|
||
|
:to => 'repositories#changes',
|
||
|
:format => 'atom',
|
||
|
:constraints => {:path => /.*/}
|
||
|
%w(browse entry raw changes annotate).each do |action|
|
||
|
get "projects/:id/repository/:repository_id/#{action}(/*path)",
|
||
|
:controller => 'repositories',
|
||
| test/integration/routing/repositories_test.rb | ||
|---|---|---|
|
should_route "GET /projects/foo/repository/svn/diff/#{path}" => "repositories#diff",
|
||
|
:id => 'foo', :repository_id => 'svn', :path => path
|
||
|
end
|
||
|
@paths.each do |path|
|
||
|
should_route "GET /projects/foo/repository/svn/changes/#{path}.atom" => "repositories#changes",
|
||
|
:id => 'foo', :repository_id => 'svn', :path => path, :format => 'atom'
|
||
|
end
|
||
|
end
|
||
|
def test_repositories_related_issues_with_repository_id
|
||
- « Previous
- 1
- 2
- 3
- 4
- Next »