From 40fb140b6d52c7bb662ce283afbc0ac8f5c692f9 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 23 Feb 2016 15:09:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E8=AE=B0=E5=BD=95diff=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 6 ++++++ app/views/repositories/_revisions.html.erb | 2 +- config/routes.rb | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 707e87fd1..95e9acc80 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -521,6 +521,12 @@ update end end + # 没次提交对应的文件差异 + def commit_diff + + end + + def diff if params[:format] == 'diff' @diff = @repository.diff(@path, @rev, @rev_to) diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb index 4d6e39f88..6de04b1d2 100644 --- a/app/views/repositories/_revisions.html.erb +++ b/app/views/repositories/_revisions.html.erb @@ -40,7 +40,7 @@ <%= textilizable(truncate_at_line_break(changeset.message)) %>
- <%= 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 %>
diff --git a/config/routes.rb b/config/routes.rb index 7060e4eb6..310fe29dd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -831,7 +831,7 @@ RedmineApp::Application.routes.draw do :controller => 'repositories', :format => false, :constraints => { - :action => /(browse|show|entry|raw|annotate|diff)/, + :action => /(browse|show|entry|raw|annotate|diff|commit_diff)/, :rev => /[a-z0-9\.\-_]+/ } @@ -850,15 +850,15 @@ RedmineApp::Application.routes.draw do :controller => 'repositories', :format => false, :constraints => { - :action => /(browse|show|entry|raw|annotate|diff)/, + :action => /(browse|show|entry|raw|annotate|diff|commit_diff)/, :rev => /[a-z0-9\.\-_]+/ } get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))', :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))', :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', :to => 'repositories#show', :path => nil