diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-03-15 08:21:26 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-03-15 08:21:26 +0000 |
commit | b6dfa0b081d0233259f653c11b6bb15dcedba9e2 (patch) | |
tree | 48b623ca6c91b17842fb030f10c01edcfd26e21e | |
parent | 1ec3f1c696f9d9a0364f0a5aa0c1aa9d36c9d93d (diff) | |
download | redmine-b6dfa0b081d0233259f653c11b6bb15dcedba9e2.tar.gz redmine-b6dfa0b081d0233259f653c11b6bb15dcedba9e2.zip |
scm: recovery showing "root @ branch" in repository tree viewing.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5139 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/repositories_controller.rb | 1 | ||||
-rw-r--r-- | app/views/repositories/_breadcrumbs.rhtml | 15 |
2 files changed, 12 insertions, 4 deletions
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index ecf900849..bdb59dfe7 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -77,6 +77,7 @@ class RepositoriesController < ApplicationController @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? @entries = @repository.entries(@path, @rev) + @changeset = @repository.find_changeset_by_name(@rev) if request.xhr? @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) else diff --git a/app/views/repositories/_breadcrumbs.rhtml b/app/views/repositories/_breadcrumbs.rhtml index 1dd2445c7..026cab93a 100644 --- a/app/views/repositories/_breadcrumbs.rhtml +++ b/app/views/repositories/_breadcrumbs.rhtml @@ -10,12 +10,19 @@ dirs.each do |dir| link_path << '/' unless link_path.empty? link_path << "#{dir}" %> - / <%= link_to h(dir), :action => 'show', :id => @project, :path => to_path_param(link_path), :rev => @rev %> + / <%= link_to h(dir), :action => 'show', :id => @project, + :path => to_path_param(link_path), :rev => @rev %> <% end %> <% if filename %> - / <%= link_to h(filename), :action => 'changes', :id => @project, :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %> + / <%= link_to h(filename), + :action => 'changes', :id => @project, + :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %> <% end %> - -<%= "@ #{h format_revision(@changeset)}" if @changeset %> +<% + # @rev is revsion or Git and Mercurial branch or tag. + # For Mercurial *tip*, @rev and @changeset are nil. + rev_text = @changeset.nil? ? @rev : format_revision(@changeset) +%> +<%= "@ #{h rev_text}" if rev_text %> <% html_title(with_leading_slash(path)) -%> |