@@ -110,7 +110,7 class RepositoriesController < ApplicationController | |||
|
110 | 110 | |
|
111 | 111 | @cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}") |
|
112 | 112 | unless read_fragment(@cache_key) |
|
113 | @diff = @repository.diff(@path, @rev, @rev_to, type) | |
|
113 | @diff = @repository.diff(@path, @rev, @rev_to, @diff_type) | |
|
114 | 114 | show_error and return unless @diff |
|
115 | 115 | end |
|
116 | 116 | end |
@@ -145,7 +145,7 private | |||
|
145 | 145 | @project = Project.find(params[:id]) |
|
146 | 146 | @repository = @project.repository |
|
147 | 147 | render_404 and return false unless @repository |
|
148 |
@path = params[:path]. |
|
|
148 | @path = params[:path].join('/') unless params[:path].nil? | |
|
149 | 149 | @path ||= '' |
|
150 | 150 | @rev = params[:rev].to_i if params[:rev] |
|
151 | 151 | rescue ActiveRecord::RecordNotFound |
@@ -1,4 +1,4 | |||
|
1 | <% form_tag({:controller => 'repositories', :action => 'diff', :id => @project}, :method => :get) do %> | |
|
1 | <% form_tag({:controller => 'repositories', :action => 'diff', :id => @project, :path => path}, :method => :get) do %> | |
|
2 | 2 | <table class="list"> |
|
3 | 3 | <thead><tr> |
|
4 | 4 | <th>#</th> |
@@ -24,6 +24,5 | |||
|
24 | 24 | <% end %> |
|
25 | 25 | </tbody> |
|
26 | 26 | </table> |
|
27 | <%= hidden_field_tag 'path', path %> | |
|
28 | 27 | <%= submit_tag(l(:label_view_diff), :class => 'small', :name => nil) if show_diff %> |
|
29 | 28 | <% end %> |
@@ -16,6 +16,13 ActionController::Routing::Routes.draw do |map| | |||
|
16 | 16 | map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations' |
|
17 | 17 | map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards' |
|
18 | 18 | map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages' |
|
19 | ||
|
20 | map.with_options :controller => 'repositories' do |omap| | |
|
21 | omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse' | |
|
22 | omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes' | |
|
23 | omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff' | |
|
24 | omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry' | |
|
25 | end | |
|
19 | 26 | |
|
20 | 27 | # Allow downloading Web Service WSDL as a file with an extension |
|
21 | 28 | # instead of a file named 'wsdl' |
General Comments 0
You need to be logged in to leave comments.
Login now