Patch #27559
Default branch should be always first in the graph
Status: | New | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | SCM | |||
Target version: | - |
Description
In the revisions view, the branches graph shows neat lines for every branch. The branches in this are sorted alphabetically. However, it is much more natural to keep the default branch leftmost all the time, so it is always a straight line. It is how e.g. the network graph in github works.
The attached patch changes the sorting of the branches to ensure, the default branch is always first.
History
#1
Updated by Toshi MARUYAMA about 5 years ago
You also need to implement in Mercurial.
ActionView::Template::Error (undefined method `is_default' for "default":Redmine::Scm::Adapters::Branch): 1: <div class="autoscroll"> 2: <% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %> 3: <%= if show_revision_graph && revisions && revisions.any? 4: indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid| 5: url_for( 6: :controller => 'repositories', 7: :action => 'revision', app/helpers/repositories_helper.rb:281:in `block in index_commits' app/helpers/repositories_helper.rb:281:in `each' app/helpers/repositories_helper.rb:281:in `sort_by' app/helpers/repositories_helper.rb:281:in `sort_by!' app/helpers/repositories_helper.rb:281:in `index_commits' app/views/repositories/_revisions.html.erb:4:in `_app_views_repositories__revisions_html_erb__4466816342598385941_70348597528700' app/views/repositories/show.html.erb:19:in `_app_views_repositories_show_html_erb___1486259103309881441_49894440' app/controllers/repositories_controller.rb:97:in `show' lib/redmine/sudo_mode.rb:63:in `sudo_mode'