Project

General

Profile

Feature #21465 ยป removed_repo.patch

Sebastian Paluch, 2016-09-13 10:53

View differences:

app/controllers/repositories_controller.rb (working copy)
114 114
    @repository.fetch_changesets if @project.active? && Setting.autofetch_changesets? && @path.empty?
115 115

  
116 116
    @entries = @repository.entries(@path, @rev)
117
    if @entries.nil? && @rev.nil?
118
      @rev = @repository.latest_changeset.revision
119
      logger.debug("show: Entries at HEAD revision not found, trying with last known revision #{@rev}")
120
      @entries = @repository.entries(@path, @rev)
121
    end
117 122
    @changeset = @repository.find_changeset_by_name(@rev)
118 123
    if request.xhr?
119 124
      @entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
......
130 135

  
131 136
  def changes
132 137
    @entry = @repository.entry(@path, @rev)
138
    if @entry.nil? && @rev.nil?
139
      @rev = @repository.latest_changeset.revision
140
      logger.debug("changes: Entry at HEAD revision not found, trying with last known revision #{@rev}")
141
      @entry = @repository.entry(@path, @rev)
142
    end
133 143
    (show_error_not_found; return) unless @entry
134 144
    @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i)
135 145
    @properties = @repository.properties(@path, @rev)
......
163 173

  
164 174
  def entry_and_raw(is_raw)
165 175
    @entry = @repository.entry(@path, @rev)
176
    if @entry.nil? && @rev.nil?
177
      @rev = @repository.latest_changeset.revision
178
      logger.debug("entry_and_raw(#{is_raw}): Entry at HEAD revision not found, trying with last known revision #{@rev}")
179
      @entry = @repository.entry(@path, @rev)
180
    end
166 181
    (show_error_not_found; return) unless @entry
167 182

  
168 183
    # If the entry is a dir, show the browser
......
207 222

  
208 223
  def annotate
209 224
    @entry = @repository.entry(@path, @rev)
225
    if @entry.nil? && @rev.nil?
226
      @rev = @repository.latest_changeset.revision
227
      logger.debug("annotate: Entry at HEAD revision not found, trying with last known revision #{@rev}")
228
      @entry = @repository.entry(@path, @rev)
229
    end
210 230
    (show_error_not_found; return) unless @entry
211 231

  
212 232
    @annotate = @repository.scm.annotate(@path, @rev)
lib/redmine/scm/adapters/subversion_adapter.rb (working copy)
154 154
          cmd << credentials_string
155 155
          cmd << " --verbose " if  options[:with_paths]
156 156
          cmd << " --limit #{options[:limit].to_i}" if options[:limit]
157
          cmd << ' ' + target(path)
157
          cmd << " #{target(path)}@#{identifier_from}"
158 158
          shellout(cmd) do |io|
159 159
            output = io.read.force_encoding('UTF-8')
160 160
            begin
    (1-1/1)