Defect #39747 » 39747.diff
app/views/repositories/diff.html.erb | ||
---|---|---|
48 | 48 |
<% end -%> |
49 | 49 | |
50 | 50 |
<% other_formats_links do |f| %> |
51 |
<%= f.link_to_with_query_parameters 'Diff', {}, :caption => 'Unified diff' %> |
|
51 |
<%= f.link_to_with_query_parameters 'Diff', { path: nil }, :caption => 'Unified diff' %>
|
|
52 | 52 |
<% end %> |
53 | 53 | |
54 | 54 |
<% html_title(with_leading_slash(@path), 'Diff') -%> |
config/routes.rb | ||
---|---|---|
299 | 299 | |
300 | 300 |
get "projects/:id/repository/:repository_id/revisions/:rev/diff(/*path)", |
301 | 301 |
:to => 'repositories#diff', |
302 |
:format => false, |
|
303 |
:constraints => {:rev => /[a-z0-9\.\-_]+/, :path => /.*/} |
|
302 |
:format => 'html', |
|
303 |
:constraints => {:rev => /[a-z0-9\.\-_]+/, :path => /.*/, format: /(html|diff)/ } |
|
304 | ||
304 | 305 |
get "projects/:id/repository/:repository_id/diff(/*path)", |
305 | 306 |
:to => 'repositories#diff', |
306 |
:format => false,
|
|
307 |
:constraints => {:path => /.*/} |
|
307 |
:format => 'html',
|
|
308 |
:constraints => {:path => /.*/, format: /(html|diff)/ }
|
|
308 | 309 | |
309 | 310 |
get 'projects/:id/repository/:repository_id/show/*path', :to => 'repositories#show', :format => 'html', :constraints => {:path => /.*/} |
310 | 311 |
test/integration/routing/repositories_test.rb | ||
---|---|---|
56 | 56 | |
57 | 57 |
should_route 'GET /projects/foo/repository/foo/revisions/2457' => 'repositories#revision', :id => 'foo', :repository_id => 'foo', :rev => '2457' |
58 | 58 |
should_route 'GET /projects/foo/repository/foo/revisions/2457/show' => 'repositories#show', :id => 'foo', :repository_id => 'foo', :rev => '2457', :format => 'html' |
59 |
should_route 'GET /projects/foo/repository/foo/revisions/2457/diff' => 'repositories#diff', :id => 'foo', :repository_id => 'foo', :rev => '2457' |
|
59 |
should_route 'GET /projects/foo/repository/foo/revisions/2457/diff' => 'repositories#diff', :id => 'foo', :repository_id => 'foo', :rev => '2457', :format => 'html'
|
|
60 | 60 | |
61 | 61 |
%w(show entry raw annotate).each do |action| |
62 | 62 |
@paths.each do |path| |
... | ... | |
66 | 66 |
end |
67 | 67 |
@paths.each do |path| |
68 | 68 |
should_route "GET /projects/foo/repository/foo/revisions/2457/diff/#{path}" => "repositories#diff", |
69 |
:id => 'foo', :repository_id => 'foo', :rev => '2457', :path => path |
|
69 |
:id => 'foo', :repository_id => 'foo', :rev => '2457', :path => path, :format => 'html'
|
|
70 | 70 |
end |
71 | 71 |
end |
72 | 72 | |
... | ... | |
85 | 85 |
end |
86 | 86 |
@paths.each do |path| |
87 | 87 |
should_route "GET /projects/foo/repository/svn/diff/#{path}" => "repositories#diff", |
88 |
:id => 'foo', :repository_id => 'svn', :path => path |
|
88 |
:id => 'foo', :repository_id => 'svn', :path => path, :format => 'html'
|
|
89 | 89 |
end |
90 | 90 |
end |
91 | 91 |