Index: app/controllers/repositories_controller.rb =================================================================== --- app/controllers/repositories_controller.rb (revision 15582) +++ app/controllers/repositories_controller.rb (working copy) @@ -114,6 +114,11 @@ @repository.fetch_changesets if @project.active? && Setting.autofetch_changesets? && @path.empty? @entries = @repository.entries(@path, @rev) + if @entries.nil? && @rev.nil? + @rev = @repository.latest_changeset.revision + logger.debug("show: Entries at HEAD revision not found, trying with last known revision #{@rev}") + @entries = @repository.entries(@path, @rev) + end @changeset = @repository.find_changeset_by_name(@rev) if request.xhr? @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) @@ -130,6 +135,11 @@ def changes @entry = @repository.entry(@path, @rev) + if @entry.nil? && @rev.nil? + @rev = @repository.latest_changeset.revision + logger.debug("changes: Entry at HEAD revision not found, trying with last known revision #{@rev}") + @entry = @repository.entry(@path, @rev) + end (show_error_not_found; return) unless @entry @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i) @properties = @repository.properties(@path, @rev) @@ -163,6 +173,11 @@ def entry_and_raw(is_raw) @entry = @repository.entry(@path, @rev) + if @entry.nil? && @rev.nil? + @rev = @repository.latest_changeset.revision + logger.debug("entry_and_raw(#{is_raw}): Entry at HEAD revision not found, trying with last known revision #{@rev}") + @entry = @repository.entry(@path, @rev) + end (show_error_not_found; return) unless @entry # If the entry is a dir, show the browser @@ -207,6 +222,11 @@ def annotate @entry = @repository.entry(@path, @rev) + if @entry.nil? && @rev.nil? + @rev = @repository.latest_changeset.revision + logger.debug("annotate: Entry at HEAD revision not found, trying with last known revision #{@rev}") + @entry = @repository.entry(@path, @rev) + end (show_error_not_found; return) unless @entry @annotate = @repository.scm.annotate(@path, @rev) Index: lib/redmine/scm/adapters/subversion_adapter.rb =================================================================== --- lib/redmine/scm/adapters/subversion_adapter.rb (revision 15582) +++ lib/redmine/scm/adapters/subversion_adapter.rb (working copy) @@ -154,7 +154,7 @@ cmd << credentials_string cmd << " --verbose " if options[:with_paths] cmd << " --limit #{options[:limit].to_i}" if options[:limit] - cmd << ' ' + target(path) + cmd << " #{target(path)}@#{identifier_from}" shellout(cmd) do |io| output = io.read.force_encoding('UTF-8') begin