版本库提交记录diff信息

This commit is contained in:
huang 2016-02-23 15:09:15 +08:00
parent 90208e166f
commit 40fb140b6d
3 changed files with 11 additions and 5 deletions

View File

@ -521,6 +521,12 @@ update
end end
end end
# 没次提交对应的文件差异
def commit_diff
end
def diff def diff
if params[:format] == 'diff' if params[:format] == 'diff'
@diff = @repository.diff(@path, @rev, @rev_to) @diff = @repository.diff(@path, @rev, @rev_to)

View File

@ -40,7 +40,7 @@
<a class="commit-row-message"><%= textilizable(truncate_at_line_break(changeset.message)) %></a> <a class="commit-row-message"><%= textilizable(truncate_at_line_break(changeset.message)) %></a>
</strong> </strong>
<div class="pull-right" title="修订号"> <div class="pull-right" title="修订号">
<%= h truncate(changeset.short_id.to_s, :length => 20) %> <%= link_to truncate(changeset.short_id.to_s, :length => 20), :controller => 'repositories', :action => 'revision', :id => repository.project, :repository_id => repository.identifier_param, :rev => rev %>
</div> </div>
<div class="notes_count"> <div class="notes_count">
</div> </div>

View File

@ -831,7 +831,7 @@ RedmineApp::Application.routes.draw do
:controller => 'repositories', :controller => 'repositories',
:format => false, :format => false,
:constraints => { :constraints => {
:action => /(browse|show|entry|raw|annotate|diff)/, :action => /(browse|show|entry|raw|annotate|diff|commit_diff)/,
:rev => /[a-z0-9\.\-_]+/ :rev => /[a-z0-9\.\-_]+/
} }
@ -850,15 +850,15 @@ RedmineApp::Application.routes.draw do
:controller => 'repositories', :controller => 'repositories',
:format => false, :format => false,
:constraints => { :constraints => {
:action => /(browse|show|entry|raw|annotate|diff)/, :action => /(browse|show|entry|raw|annotate|diff|commit_diff)/,
:rev => /[a-z0-9\.\-_]+/ :rev => /[a-z0-9\.\-_]+/
} }
get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))', get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
:controller => 'repositories', :controller => 'repositories',
:action => /(browse|show|entry|raw|changes|annotate|diff)/ :action => /(browse|show|entry|raw|changes|annotate|diff|commit_diff)/
get 'projects/:id/repository/:action(/*path(.:ext))', get 'projects/:id/repository/:action(/*path(.:ext))',
:controller => 'repositories', :controller => 'repositories',
:action => /(browse|show|entry|raw|changes|annotate|diff)/ :action => /(browse|show|entry|raw|changes|annotate|diff|commit_diff)/
get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
get 'projects/:id/repository', :to => 'repositories#show', :path => nil get 'projects/:id/repository', :to => 'repositories#show', :path => nil