@@ -67,13 +67,13 class RepositoriesController < ApplicationController | |||||
67 | redirect_to :action => 'committers', :id => @project |
|
67 | redirect_to :action => 'committers', :id => @project | |
68 | end |
|
68 | end | |
69 | end |
|
69 | end | |
70 |
|
70 | |||
71 | def destroy |
|
71 | def destroy | |
72 | @repository.destroy |
|
72 | @repository.destroy | |
73 | redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'repository' |
|
73 | redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'repository' | |
74 | end |
|
74 | end | |
75 |
|
75 | |||
76 |
def show |
|
76 | def show | |
77 | @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? |
|
77 | @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? | |
78 |
|
78 | |||
79 | @entries = @repository.entries(@path, @rev) |
|
79 | @entries = @repository.entries(@path, @rev) | |
@@ -88,7 +88,7 class RepositoriesController < ApplicationController | |||||
88 | end |
|
88 | end | |
89 |
|
89 | |||
90 | alias_method :browse, :show |
|
90 | alias_method :browse, :show | |
91 |
|
91 | |||
92 | def changes |
|
92 | def changes | |
93 | @entry = @repository.entry(@path, @rev) |
|
93 | @entry = @repository.entry(@path, @rev) | |
94 | (show_error_not_found; return) unless @entry |
|
94 | (show_error_not_found; return) unless @entry | |
@@ -96,23 +96,23 class RepositoriesController < ApplicationController | |||||
96 | @properties = @repository.properties(@path, @rev) |
|
96 | @properties = @repository.properties(@path, @rev) | |
97 | @changeset = @repository.find_changeset_by_name(@rev) |
|
97 | @changeset = @repository.find_changeset_by_name(@rev) | |
98 | end |
|
98 | end | |
99 |
|
99 | |||
100 | def revisions |
|
100 | def revisions | |
101 | @changeset_count = @repository.changesets.count |
|
101 | @changeset_count = @repository.changesets.count | |
102 | @changeset_pages = Paginator.new self, @changeset_count, |
|
102 | @changeset_pages = Paginator.new self, @changeset_count, | |
103 | per_page_option, |
|
103 | per_page_option, | |
104 | params['page'] |
|
104 | params['page'] | |
105 | @changesets = @repository.changesets.find(:all, |
|
105 | @changesets = @repository.changesets.find(:all, | |
106 |
|
|
106 | :limit => @changeset_pages.items_per_page, | |
107 |
|
|
107 | :offset => @changeset_pages.current.offset, | |
108 | :include => [:user, :repository]) |
|
108 | :include => [:user, :repository]) | |
109 |
|
109 | |||
110 | respond_to do |format| |
|
110 | respond_to do |format| | |
111 | format.html { render :layout => false if request.xhr? } |
|
111 | format.html { render :layout => false if request.xhr? } | |
112 | format.atom { render_feed(@changesets, :title => "#{@project.name}: #{l(:label_revision_plural)}") } |
|
112 | format.atom { render_feed(@changesets, :title => "#{@project.name}: #{l(:label_revision_plural)}") } | |
113 | end |
|
113 | end | |
114 | end |
|
114 | end | |
115 |
|
115 | |||
116 | def entry |
|
116 | def entry | |
117 | @entry = @repository.entry(@path, @rev) |
|
117 | @entry = @repository.entry(@path, @rev) | |
118 | (show_error_not_found; return) unless @entry |
|
118 | (show_error_not_found; return) unless @entry | |
@@ -122,7 +122,8 class RepositoriesController < ApplicationController | |||||
122 |
|
122 | |||
123 | @content = @repository.cat(@path, @rev) |
|
123 | @content = @repository.cat(@path, @rev) | |
124 | (show_error_not_found; return) unless @content |
|
124 | (show_error_not_found; return) unless @content | |
125 |
if 'raw' == params[:format] || @content.is_binary_data? || |
|
125 | if 'raw' == params[:format] || @content.is_binary_data? || | |
|
126 | (@entry.size && @entry.size > Setting.file_max_size_displayed.to_i.kilobyte) | |||
126 | # Force the download |
|
127 | # Force the download | |
127 | send_data @content, :filename => filename_for_content_disposition(@path.split('/').last) |
|
128 | send_data @content, :filename => filename_for_content_disposition(@path.split('/').last) | |
128 | else |
|
129 | else | |
@@ -135,7 +136,7 class RepositoriesController < ApplicationController | |||||
135 | def annotate |
|
136 | def annotate | |
136 | @entry = @repository.entry(@path, @rev) |
|
137 | @entry = @repository.entry(@path, @rev) | |
137 | (show_error_not_found; return) unless @entry |
|
138 | (show_error_not_found; return) unless @entry | |
138 |
|
139 | |||
139 | @annotate = @repository.scm.annotate(@path, @rev) |
|
140 | @annotate = @repository.scm.annotate(@path, @rev) | |
140 | (render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty? |
|
141 | (render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty? | |
141 | @changeset = @repository.find_changeset_by_name(@rev) |
|
142 | @changeset = @repository.find_changeset_by_name(@rev) | |
@@ -153,7 +154,7 class RepositoriesController < ApplicationController | |||||
153 | rescue ChangesetNotFound |
|
154 | rescue ChangesetNotFound | |
154 | show_error_not_found |
|
155 | show_error_not_found | |
155 | end |
|
156 | end | |
156 |
|
157 | |||
157 | def diff |
|
158 | def diff | |
158 | if params[:format] == 'diff' |
|
159 | if params[:format] == 'diff' | |
159 | @diff = @repository.diff(@path, @rev, @rev_to) |
|
160 | @diff = @repository.diff(@path, @rev, @rev_to) | |
@@ -185,11 +186,11 class RepositoriesController < ApplicationController | |||||
185 | end |
|
186 | end | |
186 | end |
|
187 | end | |
187 |
|
188 | |||
188 |
def stats |
|
189 | def stats | |
189 | end |
|
190 | end | |
190 |
|
191 | |||
191 | def graph |
|
192 | def graph | |
192 |
data = nil |
|
193 | data = nil | |
193 | case params[:graph] |
|
194 | case params[:graph] | |
194 | when "commits_per_month" |
|
195 | when "commits_per_month" | |
195 | data = graph_commits_per_month(@repository) |
|
196 | data = graph_commits_per_month(@repository) |
General Comments 0
You need to be logged in to leave comments.
Login now