Project

General

Profile

Patch #9484 » 0001-Fix-for-expensive-annotations.patch

Patch which limits 'annotate' to text files under the global size limit for viewing files directly - Antonio García-Domínguez, 2011-10-28 02:07

View differences:

app/controllers/repositories_controller.rb
@entry = @repository.entry(@path, @rev)
(show_error_not_found; return) unless @entry
@annotate = @repository.scm.annotate(@path, @rev)
(render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty?
@changeset = @repository.find_changeset_by_name(@rev)
@content = @repository.cat(@path, @rev)
(show_error_not_found; return) unless @content
if (@content.size && @content.size > Setting.file_max_size_displayed.to_i.kilobyte) ||
! is_entry_text_data?(@content, @path)
render_error :message => l(:error_scm_annotate_bad_file)
else
@annotate = @repository.scm.annotate(@path, @rev)
(render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty?
@changeset = @repository.find_changeset_by_name(@rev)
end
end
def revision
config/locales/en-GB.yml
error_scm_not_found: "The entry or revision was not found in the repository."
error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"
error_scm_annotate: "The entry does not exist or cannot be annotated."
error_scm_annotate_bad_file: "The entry exceeds the maximum text file size or is not a text file."
error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.'
error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
config/locales/en.yml
error_scm_not_found: "The entry or revision was not found in the repository."
error_scm_command_failed: "An error occurred when trying to access the repository: %{value}"
error_scm_annotate: "The entry does not exist or cannot be annotated."
error_scm_annotate_bad_file: "The entry exceeds the maximum text file size or is not a text file."
error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'
error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.'
error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").'
config/locales/es.yml
error_can_t_load_default_data: "No se ha podido cargar la configuración por defecto: %{value}"
error_issue_not_found_in_project: 'La petición no se encuentra o no está asociada a este proyecto'
error_scm_annotate: "No existe la entrada o no ha podido ser anotada"
error_scm_annotate_bad_file: "La entrada supera el tamaño máximo para ficheros de texto o no es un fichero de texto."
error_scm_command_failed: "Se produjo un error al acceder al repositorio: %{value}"
error_scm_not_found: "La entrada y/o la revisión no existe en el repositorio."
field_account: Cuenta
(1-1/2)