From c28b044d6802559a9a2a07af1b7661a1122e5f48 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Sat, 15 Aug 2009 22:41:40 +0000 Subject: [PATCH] Added branch and tag support to the git repository viewer. (#1406) Many thanks to Adam Soltys and everyone else who tested this patch. * Updated git test repository so it has a branch with some differences from the master branch * Moved redmine diff class into a module so as not to clash with diff-lcs gem which is required by grit * Find changesets from all branches, not just master * Got revision browsing working * Got file actions working properly * Allow browsing by short form of commit identifier * Added a method to retrieve repository branches * Allow browsing by branch names as well as commit numbers * Handle the case where a git repository has no master branch * Expand revision box and handle finding revisions by first 8 characters * Added branches dropdown to repository show page * Combined repository browse and show into a single action. Moved branch/revision navigation into a partial. * Renamed partial navigation -> breadcrumbs * Made it so latest revisions list uses branch and path context * Preserve current path when changing branch or revision * Perform slightly more graceful error handling in the case of invalid repository URLs * Allow branch names to contain periods * Allow dashes in branch names * Sort branches by name * Adding tags dropdown * Need to disable both branches and tags dropdowns before submitting revision form * Support underscores in revision (branch/tag) names * Making file history sensitive to current branch/tag/revision, adding common navigation to changes page * Updated translation files to include labels for 'branch', 'tag', and 'view all revisions' * Reenable fields after submit so they don't look disabled and don't stay disabled on browser back button * Instead of dashes just use empty string for default dropdown value * Individual entry views now sport the upgraded revision navigation * Don't display dropdowns with no entries * Consider all revisions when doing initial load * Fixed bug grabbing changesets. Thanks to Bernhard Furtmueller for catching. * Always check the entire log to find new revisions, rather than trying to go forward from the latest known one * Added some cleverness to avoid selecting the whole changesets table any time someone views the repository root * File copies and renames being detected properly * Return gracefully if no revisions are found in the git log * Applied patch from Babar Le Lapin to improve Windows compatibility git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2840 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/repositories_controller.rb | 28 +- app/models/repository.rb | 18 +- app/models/repository/git.rb | 87 +++-- app/views/repositories/_breadcrumbs.rhtml | 21 ++ .../repositories/_dir_list_content.rhtml | 4 +- app/views/repositories/_navigation.rhtml | 36 +- app/views/repositories/annotate.rhtml | 8 +- app/views/repositories/browse.rhtml | 6 +- app/views/repositories/changes.rhtml | 10 +- app/views/repositories/entry.rhtml | 8 +- app/views/repositories/revision.rhtml | 2 +- app/views/repositories/revisions.rhtml | 2 +- app/views/repositories/show.rhtml | 13 +- config/locales/bg.yml | 3 + config/locales/bs.yml | 3 + config/locales/ca.yml | 3 + config/locales/cs.yml | 3 + config/locales/da.yml | 3 + config/locales/de.yml | 3 + config/locales/en.yml | 3 + config/locales/es.yml | 3 + config/locales/fi.yml | 3 + config/locales/fr.yml | 5 +- config/locales/gl.yml | 3 + config/locales/he.yml | 3 + config/locales/hu.yml | 3 + config/locales/it.yml | 3 + config/locales/ja.yml | 3 + config/locales/ko.yml | 3 + config/locales/lt.yml | 3 + config/locales/nl.yml | 3 + config/locales/no.yml | 3 + config/locales/pl.yml | 3 + config/locales/pt-BR.yml | 3 + config/locales/pt.yml | 3 + config/locales/ro.yml | 3 + config/locales/ru.yml | 3 + config/locales/sk.yml | 5 +- config/locales/sl.yml | 3 + config/locales/sr.yml | 3 + config/locales/sv.yml | 3 + config/locales/th.yml | 3 + config/locales/tr.yml | 3 + config/locales/uk.yml | 3 + config/locales/vi.yml | 3 + config/locales/zh-TW.yml | 3 + config/locales/zh.yml | 3 + config/routes.rb | 2 +- lib/diff.rb | 356 +++++++++--------- lib/redmine/scm/adapters/abstract_adapter.rb | 33 +- lib/redmine/scm/adapters/git_adapter.rb | 215 +++++------ public/javascripts/repository_navigation.js | 35 ++ public/stylesheets/application.css | 2 +- .../repositories/git_repository.tar.gz | Bin 12445 -> 17716 bytes .../repositories_bazaar_controller_test.rb | 14 +- .../repositories_cvs_controller_test.rb | 14 +- .../repositories_darcs_controller_test.rb | 12 +- .../repositories_git_controller_test.rb | 43 ++- .../repositories_mercurial_controller_test.rb | 20 +- ...repositories_subversion_controller_test.rb | 14 +- test/unit/git_adapter_test.rb | 22 ++ test/unit/repository_git_test.rb | 8 +- 62 files changed, 699 insertions(+), 440 deletions(-) create mode 100644 app/views/repositories/_breadcrumbs.rhtml create mode 100644 public/javascripts/repository_navigation.js create mode 100644 test/unit/git_adapter_test.rb diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 201845fa5..bddaa77d8 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -64,31 +64,26 @@ class RepositoriesController < ApplicationController redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'repository' end - def show - # check if new revisions have been committed in the repository - @repository.fetch_changesets if Setting.autofetch_changesets? - # root entries - @entries = @repository.entries('', @rev) - # latest changesets - @changesets = @repository.changesets.find(:all, :limit => 10, :order => "committed_on DESC") - show_error_not_found unless @entries || @changesets.any? - end - - def browse + def show + @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? + @entries = @repository.entries(@path, @rev) if request.xhr? @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) else show_error_not_found and return unless @entries + @changesets = @repository.latest_changesets(@path, @rev) @properties = @repository.properties(@path, @rev) - render :action => 'browse' + render :action => 'show' end end + + alias_method :browse, :show def changes @entry = @repository.entry(@path, @rev) show_error_not_found and return unless @entry - @changesets = @repository.changesets_for_path(@path, :limit => Setting.repository_log_display_limit.to_i) + @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i) @properties = @repository.properties(@path, @rev) end @@ -135,7 +130,7 @@ class RepositoriesController < ApplicationController end def revision - @changeset = @repository.changesets.find_by_revision(@rev) + @changeset = @repository.changesets.find(:first, :conditions => ["revision LIKE ?", @rev + '%']) raise ChangesetNotFound unless @changeset respond_to do |format| @@ -199,17 +194,14 @@ private render_404 end - REV_PARAM_RE = %r{^[a-f0-9]*$} - def find_repository @project = Project.find(params[:id]) @repository = @project.repository render_404 and return false unless @repository @path = params[:path].join('/') unless params[:path].nil? @path ||= '' - @rev = params[:rev] + @rev = params[:rev].blank? ? @repository.default_branch : params[:rev].strip @rev_to = params[:rev_to] - raise InvalidRevisionParam unless @rev.to_s.match(REV_PARAM_RE) && @rev.to_s.match(REV_PARAM_RE) rescue ActiveRecord::RecordNotFound render_404 rescue InvalidRevisionParam diff --git a/app/models/repository.rb b/app/models/repository.rb index bf181bfad..860395b5c 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -62,6 +62,18 @@ class Repository < ActiveRecord::Base def entries(path=nil, identifier=nil) scm.entries(path, identifier) end + + def branches + scm.branches + end + + def tags + scm.tags + end + + def default_branch + scm.default_branch + end def properties(path, identifier=nil) scm.properties(path, identifier) @@ -92,11 +104,15 @@ class Repository < ActiveRecord::Base def latest_changeset @latest_changeset ||= changesets.find(:first) end + + def latest_changesets(path,rev,limit=10) + @latest_changesets ||= changesets.find(:all, limit, :order => "committed_on DESC") + end def scan_changesets_for_issue_ids self.changesets.each(&:scan_comment_for_issue_ids) end - + # Returns an array of committers usernames and associated user_id def committers @committers ||= Changeset.connection.select_rows("SELECT DISTINCT committer, user_id FROM #{Changeset.table_name} WHERE repository_id = #{id}") diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index f721b938f..b3cdf3643 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -29,43 +29,60 @@ class Repository::Git < Repository 'Git' end - def changesets_for_path(path, options={}) - Change.find(:all, :include => {:changeset => :user}, - :conditions => ["repository_id = ? AND path = ?", id, path], - :order => "committed_on DESC, #{Changeset.table_name}.revision DESC", - :limit => options[:limit]).collect(&:changeset) + def branches + scm.branches end - def fetch_changesets - scm_info = scm.info - if scm_info - # latest revision found in database - db_revision = latest_changeset ? latest_changeset.revision : nil - # latest revision in the repository - scm_revision = scm_info.lastrev.scmid + def tags + scm.tags + end - unless changesets.find_by_scmid(scm_revision) - scm.revisions('', db_revision, nil, :reverse => true) do |revision| - if changesets.find_by_scmid(revision.scmid.to_s).nil? - transaction do - changeset = Changeset.create!(:repository => self, - :revision => revision.identifier, - :scmid => revision.scmid, - :committer => revision.author, - :committed_on => revision.time, - :comments => revision.message) - - revision.paths.each do |change| - Change.create!(:changeset => changeset, - :action => change[:action], - :path => change[:path], - :from_path => change[:from_path], - :from_revision => change[:from_revision]) - end - end - end - end - end - end + def changesets_for_path(path, options={}) + Change.find( + :all, + :include => {:changeset => :user}, + :conditions => ["repository_id = ? AND path = ?", id, path], + :order => "committed_on DESC, #{Changeset.table_name}.revision DESC", + :limit => options[:limit] + ).collect(&:changeset) + end + + # With SCM's that have a sequential commit numbering, redmine is able to be + # clever and only fetch changesets going forward from the most recent one + # it knows about. However, with git, you never know if people have merged + # commits into the middle of the repository history, so we always have to + # parse the entire log. + def fetch_changesets + # Save ourselves an expensive operation if we're already up to date + return if scm.num_revisions == changesets.count + + revisions = scm.revisions('', nil, nil, :all => true) + return if revisions.nil? || revisions.empty? + + # Find revisions that redmine knows about already + existing_revisions = changesets.find(:all).map!{|c| c.scmid} + + # Clean out revisions that are no longer in git + Changeset.delete_all(["scmid NOT IN (?) AND repository_id = (?)", revisions.map{|r| r.scmid}, self.id]) + + # Subtract revisions that redmine already knows about + revisions.reject!{|r| existing_revisions.include?(r.scmid)} + + # Save the remaining ones to the database + revisions.each{|r| r.save(self)} unless revisions.nil? + end + + def latest_changesets(path,rev,limit=10) + revisions = scm.revisions(path, nil, rev, :limit => limit, :all => false) + return [] if revisions.nil? || revisions.empty? + + changesets.find( + :all, + :conditions => [ + "scmid IN (?)", + revisions.map!{|c| c.scmid} + ], + :order => 'committed_on DESC' + ) end end diff --git a/app/views/repositories/_breadcrumbs.rhtml b/app/views/repositories/_breadcrumbs.rhtml new file mode 100644 index 000000000..42d11e1a4 --- /dev/null +++ b/app/views/repositories/_breadcrumbs.rhtml @@ -0,0 +1,21 @@ +<%= link_to 'root', :action => 'show', :id => @project, :path => '', :rev => @rev %> +<% +dirs = path.split('/') +if 'file' == kind + filename = dirs.pop +end +link_path = '' +dirs.each do |dir| + next if dir.blank? + 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 %> +<% end %> +<% if filename %> + / <%= link_to h(filename), :action => 'changes', :id => @project, :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %> +<% end %> + +<%= "@ #{revision}" if revision %> + +<% html_title(with_leading_slash(path)) -%> diff --git a/app/views/repositories/_dir_list_content.rhtml b/app/views/repositories/_dir_list_content.rhtml index bcffed4a5..8b6a067b3 100644 --- a/app/views/repositories/_dir_list_content.rhtml +++ b/app/views/repositories/_dir_list_content.rhtml @@ -4,7 +4,7 @@ <% if entry.is_dir? %> -">  <% end %> <%= link_to h(entry.name), - {:action => (entry.is_dir? ? 'browse' : 'changes'), :id => @project, :path => to_path_param(entry.path), :rev => @rev}, + {:action => (entry.is_dir? ? 'show' : 'changes'), :id => @project, :path => to_path_param(entry.path), :rev => @rev}, :class => (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(entry.name)}")%> <%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %> diff --git a/app/views/repositories/_navigation.rhtml b/app/views/repositories/_navigation.rhtml index 25a15f496..d1417a61c 100644 --- a/app/views/repositories/_navigation.rhtml +++ b/app/views/repositories/_navigation.rhtml @@ -1,21 +1,21 @@ -<%= link_to 'root', :action => 'browse', :id => @project, :path => '', :rev => @rev %> -<% -dirs = path.split('/') -if 'file' == kind - filename = dirs.pop -end -link_path = '' -dirs.each do |dir| - next if dir.blank? - link_path << '/' unless link_path.empty? - link_path << "#{dir}" - %> - / <%= link_to h(dir), :action => 'browse', :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 %> +<% content_for :header_tags do %> + <%= javascript_include_tag 'repository_navigation' %> <% end %> -<%= "@ #{revision}" if revision %> +<%= link_to l(:label_statistics), {:action => 'stats', :id => @project}, :class => 'icon icon-stats' %> -<% html_title(with_leading_slash(path)) -%> +<% form_tag({:action => controller.action_name, :id => @project, :path => @path, :rev => ''}, {:method => :get, :id => 'revision_selector'}) do -%> + + <% if !@repository.branches.nil? && @repository.branches.length > 0 -%> + | <%= l(:label_branch) %>: + <%= select_tag :branch, options_for_select([''] + @repository.branches,@rev), :id => 'branch' %> + <% end -%> + + <% if !@repository.tags.nil? && @repository.tags.length > 0 -%> + | <%= l(:label_tag) %>: + <%= select_tag :tag, options_for_select([''] + @repository.tags,@rev), :id => 'tag' %> + <% end -%> + + | <%= l(:label_revision) %>: + <%= text_field_tag 'rev', @rev, :size => 8 %> +<% end -%> diff --git a/app/views/repositories/annotate.rhtml b/app/views/repositories/annotate.rhtml index d0fb8cbf9..fd4d63f3a 100644 --- a/app/views/repositories/annotate.rhtml +++ b/app/views/repositories/annotate.rhtml @@ -1,4 +1,10 @@ -

<%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %>

+<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %> + +
+ <%= render :partial => 'navigation' %> +
+ +

<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %>

<%= render :partial => 'link_to_functions' %>

diff --git a/app/views/repositories/browse.rhtml b/app/views/repositories/browse.rhtml index 3bf320cef..fc769aa22 100644 --- a/app/views/repositories/browse.rhtml +++ b/app/views/repositories/browse.rhtml @@ -1,10 +1,8 @@
-<% form_tag({}, :method => :get) do %> -<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %> -<% end %> +<%= render :partial => 'navigation' %>
-

<%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'dir', :revision => @rev } %>

+

<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'dir', :revision => @rev } %>

<%= render :partial => 'dir_list' %> <%= render_properties(@properties) %> diff --git a/app/views/repositories/changes.rhtml b/app/views/repositories/changes.rhtml index aa359ef4d..3d4c7a96b 100644 --- a/app/views/repositories/changes.rhtml +++ b/app/views/repositories/changes.rhtml @@ -1,4 +1,12 @@ -

<%= render :partial => 'navigation', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %>

+<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %> + +
+ <%= render :partial => 'navigation' %> +
+ +

+ <%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => (@entry ? @entry.kind : nil), :revision => @rev } %> +

<%= render :partial => 'link_to_functions' %>

diff --git a/app/views/repositories/entry.rhtml b/app/views/repositories/entry.rhtml index 12ba9f428..1e198806d 100644 --- a/app/views/repositories/entry.rhtml +++ b/app/views/repositories/entry.rhtml @@ -1,4 +1,10 @@ -

<%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %>

+<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %> + +
+ <%= render :partial => 'navigation' %> +
+ +

<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'file', :revision => @rev } %>

<%= render :partial => 'link_to_functions' %>

diff --git a/app/views/repositories/revision.rhtml b/app/views/repositories/revision.rhtml index b60b2a22a..f992f046d 100644 --- a/app/views/repositories/revision.rhtml +++ b/app/views/repositories/revision.rhtml @@ -14,7 +14,7 @@ »  <% form_tag({:controller => 'repositories', :action => 'revision', :id => @project, :rev => nil}, :method => :get) do %> - <%= text_field_tag 'rev', @rev, :size => 5 %> + <%= text_field_tag 'rev', @rev[0,8], :size => 8 %> <%= submit_tag 'OK', :name => nil %> <% end %> diff --git a/app/views/repositories/revisions.rhtml b/app/views/repositories/revisions.rhtml index c06c204cd..255cb6221 100644 --- a/app/views/repositories/revisions.rhtml +++ b/app/views/repositories/revisions.rhtml @@ -1,6 +1,6 @@
<% form_tag({:action => 'revision', :id => @project}) do %> -<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %> +<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 8 %> <%= submit_tag 'OK' %> <% end %>
diff --git a/app/views/repositories/show.rhtml b/app/views/repositories/show.rhtml index a0f7dc33c..aae6571f0 100644 --- a/app/views/repositories/show.rhtml +++ b/app/views/repositories/show.rhtml @@ -1,15 +1,10 @@ -
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %> -<%= link_to l(:label_statistics), {:action => 'stats', :id => @project}, :class => 'icon icon-stats' %> -<% if !@entries.nil? && authorize_for('repositories', 'browse') -%> -<% form_tag({:action => 'browse', :id => @project}, :method => :get) do -%> -| <%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 5 %> -<% end -%> -<% end -%> +
+ <%= render :partial => 'navigation' %>
-

<%= l(:label_repository) %> (<%= @repository.scm_name %>)

+

<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'dir', :revision => @rev } %>

<% if !@entries.nil? && authorize_for('repositories', 'browse') %> <%= render :partial => 'dir_list' %> @@ -18,7 +13,7 @@ <% if !@changesets.empty? && authorize_for('repositories', 'revisions') %>

<%= l(:label_latest_revision_plural) %>

<%= render :partial => 'revisions', :locals => {:project => @project, :path => '', :revisions => @changesets, :entry => nil }%> -

<%= link_to l(:label_view_revisions), :action => 'revisions', :id => @project %>

+

<%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project %>

<% content_for :header_tags do %> <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :action => 'revisions', :id => @project, :page => nil, :key => User.current.rss_key})) %> <% end %> diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 87ed7c037..a683f875b 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -798,3 +798,6 @@ bg: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/bs.yml b/config/locales/bs.yml index 2f8d94512..d78e61140 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -831,3 +831,6 @@ bs: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 499001dee..049f734bc 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -801,3 +801,6 @@ ca: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 7444da07a..4e1afa6f1 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -804,3 +804,6 @@ cs: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/da.yml b/config/locales/da.yml index 99b47599c..f438805a8 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -831,3 +831,6 @@ da: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/de.yml b/config/locales/de.yml index 6969d7a60..14dab4071 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -830,3 +830,6 @@ de: mail_body_wiki_content_updated: "Die Wiki-Seite '{{page}}' wurde von {{author}} aktualisiert." permission_add_project: Erstelle Projekt setting_new_project_user_role_id: Rolle einem Nicht-Administrator zugeordnet, welcher ein Projekt erstellt + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/en.yml b/config/locales/en.yml index 459a34ef4..b907a56b4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -543,6 +543,8 @@ en: label_browse: Browse label_modification: "{{count}} change" label_modification_plural: "{{count}} changes" + label_branch: Branch + label_tag: Tag label_revision: Revision label_revision_plural: Revisions label_associated_revisions: Associated revisions @@ -554,6 +556,7 @@ en: label_latest_revision: Latest revision label_latest_revision_plural: Latest revisions label_view_revisions: View revisions + label_view_all_revisions: View all revisions label_max_size: Maximum size label_sort_highest: Move to top label_sort_higher: Move up diff --git a/config/locales/es.yml b/config/locales/es.yml index f0689b86b..89e4aaf6b 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -851,3 +851,6 @@ es: mail_body_wiki_content_updated: La página wiki '{{page}}' ha sido actualizada por {{author}}. permission_add_project: Crear proyecto setting_new_project_user_role_id: Permiso asignado a un usuario no-administrador para crear proyectos + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 759af0643..2fa1c4ce7 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -841,3 +841,6 @@ fi: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 2e3ca60bb..9e691bb6e 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -832,4 +832,7 @@ fr: enumeration_doc_categories: Catégories des documents enumeration_activities: Activités (suivi du temps) label_greater_or_equal: ">=" - label_less_or_equal: <= + label_less_or_equal: "<=" + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 4cc93a5e7..7f44b8196 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -830,3 +830,6 @@ gl: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/he.yml b/config/locales/he.yml index a1846f4de..94cf716cd 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -813,3 +813,6 @@ he: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 824694942..c204aaad3 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -836,3 +836,6 @@ mail_body_wiki_content_updated: A '{{page}}' wiki oldalt {{author}} frissítette. permission_add_project: Projekt létrehozása setting_new_project_user_role_id: Projekt létrehozási jog nem adminisztrátor felhasználóknak + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/it.yml b/config/locales/it.yml index 2a0016600..fa490e7c6 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -816,3 +816,6 @@ it: mail_body_wiki_content_updated: La pagina '{{page}}' wiki è stata aggiornata da{{author}}. permission_add_project: Crea progetto setting_new_project_user_role_id: Ruolo assegnato agli utenti non amministratori che creano un progetto + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/ja.yml b/config/locales/ja.yml index e3f09379f..1d1c330b2 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -838,3 +838,6 @@ ja: enumeration_issue_priorities: チケットの優先度 enumeration_doc_categories: 文書カテゴリ enumeration_activities: 作業分類 (時間トラッキング) + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 5dee19a4b..a69e6af6c 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -869,3 +869,6 @@ ko: # by Kihyun Yoon(ddumbugie@gmail.com) # by John Hwang (jhwang@tavon.org),http://github.com/tavon field_issue_to: Related issue + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 8565425af..49e59720e 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -841,3 +841,6 @@ lt: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/nl.yml b/config/locales/nl.yml index e97a39130..df95addcc 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -786,3 +786,6 @@ nl: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/no.yml b/config/locales/no.yml index a32d59a61..1e449573d 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -803,3 +803,6 @@ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 3f80f1590..016b55529 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -834,3 +834,6 @@ pl: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index bc08ed16b..e308e4810 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -836,3 +836,6 @@ pt-BR: mail_body_wiki_content_updated: A página wiki '{{page}}' foi atualizada por {{author}}. permission_add_project: Criar projeto setting_new_project_user_role_id: Papel dado a um usuário não administrador que crie um projeto + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/pt.yml b/config/locales/pt.yml index f10f89803..5bf3dbb0d 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -822,3 +822,6 @@ pt: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/ro.yml b/config/locales/ro.yml index 0497b14e1..d9409b99d 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -801,3 +801,6 @@ ro: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 525c3c04f..08373c64b 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -928,3 +928,6 @@ ru: mail_body_wiki_content_updated: "{{author}} обновил(а) wiki-страницу '{{page}}'." permission_add_project: Создание проекта setting_new_project_user_role_id: Роль, назначаемая пользователю, создавшему проект + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/sk.yml b/config/locales/sk.yml index a7b73b782..27a0a32ea 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -802,4 +802,7 @@ sk: label_wiki_content_updated: Wiki stránka aktualizovaná mail_body_wiki_content_updated: Wiki stránka '{{page}}' bola aktualizovaná užívateľom {{author}}. setting_repositories_encodings: Kódovanie repozitára - setting_new_project_user_role_id: Rola dána non-admin užívateľovi, ktorý vytvorí projekt \ No newline at end of file + setting_new_project_user_role_id: Rola dána non-admin užívateľovi, ktorý vytvorí projekt + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 7f01d35a1..6a1f4e273 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -800,3 +800,6 @@ sl: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/sr.yml b/config/locales/sr.yml index 8edd6d79f..5e565a9ca 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -824,3 +824,6 @@ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 648c0d986..0e75a25e9 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -858,3 +858,6 @@ sv: enumeration_issue_priorities: Ärendeprioriteter enumeration_doc_categories: Dokumentkategorier enumeration_activities: Aktiviteter (tidsuppföljning) + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/th.yml b/config/locales/th.yml index 046ca8131..3eb1a2584 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -801,3 +801,6 @@ th: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/tr.yml b/config/locales/tr.yml index b830f90c5..d6822490d 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -837,3 +837,6 @@ tr: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 403b42cae..e95ce4048 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -800,3 +800,6 @@ uk: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/vi.yml b/config/locales/vi.yml index dfe7a60f1..210532849 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -870,3 +870,6 @@ vi: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 2b757e587..85100f913 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -908,3 +908,6 @@ enumeration_issue_priorities: 項目優先權 enumeration_doc_categories: 文件分類 enumeration_activities: 活動 (時間追蹤) + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 31a19b3c6..a25ef9617 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -833,3 +833,6 @@ zh: enumeration_issue_priorities: 问题优先级 enumeration_doc_categories: 文档类别 enumeration_activities: 活动(时间跟踪) + label_view_all_revisions: View all revisions + label_tag: Tag + label_branch: Branch diff --git a/config/routes.rb b/config/routes.rb index bfacb1d3a..ded3435ba 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -218,7 +218,7 @@ ActionController::Routing::Routes.draw do |map| repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' - repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path' + repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ } repository_views.connect 'projects/:id/repository/:action/*path' end diff --git a/lib/diff.rb b/lib/diff.rb index 646f91bae..f88e7fbb1 100644 --- a/lib/diff.rb +++ b/lib/diff.rb @@ -1,153 +1,155 @@ -class Diff +module RedmineDiff + class Diff - VERSION = 0.3 + VERSION = 0.3 - def Diff.lcs(a, b) - astart = 0 - bstart = 0 - afinish = a.length-1 - bfinish = b.length-1 - mvector = [] - - # First we prune off any common elements at the beginning - while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart]) - mvector[astart] = bstart - astart += 1 - bstart += 1 + def Diff.lcs(a, b) + astart = 0 + bstart = 0 + afinish = a.length-1 + bfinish = b.length-1 + mvector = [] + + # First we prune off any common elements at the beginning + while (astart <= afinish && bstart <= afinish && a[astart] == b[bstart]) + mvector[astart] = bstart + astart += 1 + bstart += 1 + end + + # now the end + while (astart <= afinish && bstart <= bfinish && a[afinish] == b[bfinish]) + mvector[afinish] = bfinish + afinish -= 1 + bfinish -= 1 + end + + bmatches = b.reverse_hash(bstart..bfinish) + thresh = [] + links = [] + + (astart..afinish).each { |aindex| + aelem = a[aindex] + next unless bmatches.has_key? aelem + k = nil + bmatches[aelem].reverse.each { |bindex| + if k && (thresh[k] > bindex) && (thresh[k-1] < bindex) + thresh[k] = bindex + else + k = thresh.replacenextlarger(bindex, k) end - - # now the end - while (astart <= afinish && bstart <= bfinish && a[afinish] == b[bfinish]) - mvector[afinish] = bfinish - afinish -= 1 - bfinish -= 1 - end - - bmatches = b.reverse_hash(bstart..bfinish) - thresh = [] - links = [] - - (astart..afinish).each { |aindex| - aelem = a[aindex] - next unless bmatches.has_key? aelem - k = nil - bmatches[aelem].reverse.each { |bindex| - if k && (thresh[k] > bindex) && (thresh[k-1] < bindex) - thresh[k] = bindex - else - k = thresh.replacenextlarger(bindex, k) - end - links[k] = [ (k==0) ? nil : links[k-1], aindex, bindex ] if k + links[k] = [ (k==0) ? nil : links[k-1], aindex, bindex ] if k + } } - } - if !thresh.empty? - link = links[thresh.length-1] - while link - mvector[link[1]] = link[2] - link = link[0] + if !thresh.empty? + link = links[thresh.length-1] + while link + mvector[link[1]] = link[2] + link = link[0] + end end + + return mvector end - return mvector - end - - def makediff(a, b) - mvector = Diff.lcs(a, b) - ai = bi = 0 - while ai < mvector.length - bline = mvector[ai] - if bline - while bi < bline - discardb(bi, b[bi]) - bi += 1 - end - match(ai, bi) - bi += 1 - else - discarda(ai, a[ai]) - end - ai += 1 - end - while ai < a.length - discarda(ai, a[ai]) - ai += 1 - end - while bi < b.length + def makediff(a, b) + mvector = Diff.lcs(a, b) + ai = bi = 0 + while ai < mvector.length + bline = mvector[ai] + if bline + while bi < bline discardb(bi, b[bi]) bi += 1 end match(ai, bi) - 1 - end - - def compactdiffs - diffs = [] - @diffs.each { |df| - i = 0 - curdiff = [] - while i < df.length - whot = df[i][0] - s = @isstring ? df[i][2].chr : [df[i][2]] - p = df[i][1] - last = df[i][1] - i += 1 - while df[i] && df[i][0] == whot && df[i][1] == last+1 - s << df[i][2] - last = df[i][1] - i += 1 - end - curdiff.push [whot, p, s] + bi += 1 + else + discarda(ai, a[ai]) + end + ai += 1 end - diffs.push curdiff - } - return diffs - end - - attr_reader :diffs, :difftype - - def initialize(diffs_or_a, b = nil, isstring = nil) - if b.nil? - @diffs = diffs_or_a - @isstring = isstring - else - @diffs = [] - @curdiffs = [] - makediff(diffs_or_a, b) - @difftype = diffs_or_a.class + while ai < a.length + discarda(ai, a[ai]) + ai += 1 + end + while bi < b.length + discardb(bi, b[bi]) + bi += 1 + end + match(ai, bi) + 1 end - end - - def match(ai, bi) - @diffs.push @curdiffs unless @curdiffs.empty? - @curdiffs = [] - end - def discarda(i, elem) - @curdiffs.push ['-', i, elem] - end + def compactdiffs + diffs = [] + @diffs.each { |df| + i = 0 + curdiff = [] + while i < df.length + whot = df[i][0] + s = @isstring ? df[i][2].chr : [df[i][2]] + p = df[i][1] + last = df[i][1] + i += 1 + while df[i] && df[i][0] == whot && df[i][1] == last+1 + s << df[i][2] + last = df[i][1] + i += 1 + end + curdiff.push [whot, p, s] + end + diffs.push curdiff + } + return diffs + end - def discardb(i, elem) - @curdiffs.push ['+', i, elem] - end + attr_reader :diffs, :difftype - def compact - return Diff.new(compactdiffs) - end + def initialize(diffs_or_a, b = nil, isstring = nil) + if b.nil? + @diffs = diffs_or_a + @isstring = isstring + else + @diffs = [] + @curdiffs = [] + makediff(diffs_or_a, b) + @difftype = diffs_or_a.class + end + end + + def match(ai, bi) + @diffs.push @curdiffs unless @curdiffs.empty? + @curdiffs = [] + end - def compact! - @diffs = compactdiffs - end + def discarda(i, elem) + @curdiffs.push ['-', i, elem] + end - def inspect - @diffs.inspect - end + def discardb(i, elem) + @curdiffs.push ['+', i, elem] + end + def compact + return Diff.new(compactdiffs) + end + + def compact! + @diffs = compactdiffs + end + + def inspect + @diffs.inspect + end + + end end module Diffable def diff(b) - Diff.new(self, b) + RedmineDiff::Diff.new(self, b) end # Create a hash that maps elements of the array to arrays of indices @@ -158,9 +160,9 @@ module Diffable range.each { |i| elem = self[i] if revmap.has_key? elem - revmap[elem].push i + revmap[elem].push i else - revmap[elem] = [i] + revmap[elem] = [i] end } return revmap @@ -179,9 +181,9 @@ module Diffable found = self[index] return nil if value == found if value > found - low = index + 1 + low = index + 1 else - high = index + high = index end end @@ -204,25 +206,25 @@ module Diffable bi = 0 diff.diffs.each { |d| d.each { |mod| - case mod[0] - when '-' - while ai < mod[1] - newary << self[ai] - ai += 1 - bi += 1 - end - ai += 1 - when '+' - while bi < mod[1] - newary << self[ai] - ai += 1 - bi += 1 - end - newary << mod[2] - bi += 1 - else - raise "Unknown diff action" - end + case mod[0] + when '-' + while ai < mod[1] + newary << self[ai] + ai += 1 + bi += 1 + end + ai += 1 + when '+' + while bi < mod[1] + newary << self[ai] + ai += 1 + bi += 1 + end + newary << mod[2] + bi += 1 + else + raise "Unknown diff action" + end } } while ai < self.length @@ -243,38 +245,38 @@ class String end =begin -= Diff -(({diff.rb})) - computes the differences between two arrays or -strings. Copyright (C) 2001 Lars Christensen + = Diff + (({diff.rb})) - computes the differences between two arrays or + strings. Copyright (C) 2001 Lars Christensen -== Synopsis + == Synopsis - diff = Diff.new(a, b) - b = a.patch(diff) + diff = Diff.new(a, b) + b = a.patch(diff) -== Class Diff -=== Class Methods ---- Diff.new(a, b) ---- a.diff(b) - Creates a Diff object which represent the differences between - ((|a|)) and ((|b|)). ((|a|)) and ((|b|)) can be either be arrays - of any objects, strings, or object of any class that include - module ((|Diffable|)) + == Class Diff + === Class Methods + --- Diff.new(a, b) + --- a.diff(b) + Creates a Diff object which represent the differences between + ((|a|)) and ((|b|)). ((|a|)) and ((|b|)) can be either be arrays + of any objects, strings, or object of any class that include + module ((|Diffable|)) -== Module Diffable -The module ((|Diffable|)) is intended to be included in any class for -which differences are to be computed. Diffable is included into String -and Array when (({diff.rb})) is (({require}))'d. + == Module Diffable + The module ((|Diffable|)) is intended to be included in any class for + which differences are to be computed. Diffable is included into String + and Array when (({diff.rb})) is (({require}))'d. -Classes including Diffable should implement (({[]})) to get element at -integer indices, (({<<})) to append elements to the object and -(({ClassName#new})) should accept 0 arguments to create a new empty -object. + Classes including Diffable should implement (({[]})) to get element at + integer indices, (({<<})) to append elements to the object and + (({ClassName#new})) should accept 0 arguments to create a new empty + object. -=== Instance Methods ---- Diffable#patch(diff) - Applies the differences from ((|diff|)) to the object ((|obj|)) - and return the result. ((|obj|)) is not changed. ((|obj|)) and - can be either an array or a string, but must match the object - from which the ((|diff|)) was created. + === Instance Methods + --- Diffable#patch(diff) + Applies the differences from ((|diff|)) to the object ((|obj|)) + and return the result. ((|obj|)) is not changed. ((|obj|)) and + can be either an array or a string, but must match the object + from which the ((|diff|)) was created. =end diff --git a/lib/redmine/scm/adapters/abstract_adapter.rb b/lib/redmine/scm/adapters/abstract_adapter.rb index 7d21f8eba..a62076b52 100644 --- a/lib/redmine/scm/adapters/abstract_adapter.rb +++ b/lib/redmine/scm/adapters/abstract_adapter.rb @@ -100,6 +100,18 @@ module Redmine def entries(path=nil, identifier=nil) return nil end + + def branches + return nil + end + + def tags + return nil + end + + def default_branch + return nil + end def properties(path, identifier=nil) return nil @@ -260,6 +272,7 @@ module Redmine class Revision attr_accessor :identifier, :scmid, :name, :author, :time, :message, :paths, :revision, :branch + def initialize(attributes={}) self.identifier = attributes[:identifier] self.scmid = attributes[:scmid] @@ -271,7 +284,25 @@ module Redmine self.revision = attributes[:revision] self.branch = attributes[:branch] end - + + def save(repo) + if repo.changesets.find_by_scmid(scmid.to_s).nil? + changeset = Changeset.create!( + :repository => repo, + :revision => identifier, + :scmid => scmid, + :committer => author, + :committed_on => time, + :comments => message) + + paths.each do |file| + Change.create!( + :changeset => changeset, + :action => file[:action], + :path => file[:path]) + end + end + end end class Annotate diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index a9e1dda5c..14e1674b1 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -21,90 +21,38 @@ module Redmine module Scm module Adapters class GitAdapter < AbstractAdapter - # Git executable name GIT_BIN = "git" - # Get the revision of a particuliar file - def get_rev (rev,path) - - if rev != 'latest' && !rev.nil? - cmd="#{GIT_BIN} --git-dir #{target('')} show --date=iso --pretty=fuller #{shell_quote rev} -- #{shell_quote path}" - else - @branch ||= shellout("#{GIT_BIN} --git-dir #{target('')} branch") { |io| io.grep(/\*/)[0].strip.match(/\* (.*)/)[1] } - cmd="#{GIT_BIN} --git-dir #{target('')} log --date=iso --pretty=fuller -1 #{@branch} -- #{shell_quote path}" - end - rev=[] - i=0 - shellout(cmd) do |io| - files=[] - changeset = {} - parsing_descr = 0 #0: not parsing desc or files, 1: parsing desc, 2: parsing files - - io.each_line do |line| - if line =~ /^commit ([0-9a-f]{40})$/ - key = "commit" - value = $1 - if (parsing_descr == 1 || parsing_descr == 2) - parsing_descr = 0 - rev = Revision.new({:identifier => changeset[:commit], - :scmid => changeset[:commit], - :author => changeset[:author], - :time => Time.parse(changeset[:date]), - :message => changeset[:description], - :paths => files - }) - changeset = {} - files = [] - end - changeset[:commit] = $1 - elsif (parsing_descr == 0) && line =~ /^(\w+):\s*(.*)$/ - key = $1 - value = $2 - if key == "Author" - changeset[:author] = value - elsif key == "CommitDate" - changeset[:date] = value - end - elsif (parsing_descr == 0) && line.chomp.to_s == "" - parsing_descr = 1 - changeset[:description] = "" - elsif (parsing_descr == 1 || parsing_descr == 2) && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\s+(.+)$/ - parsing_descr = 2 - fileaction = $1 - filepath = $2 - files << {:action => fileaction, :path => filepath} - elsif (parsing_descr == 1) && line.chomp.to_s == "" - parsing_descr = 2 - elsif (parsing_descr == 1) - changeset[:description] << line - end - end - rev = Revision.new({:identifier => changeset[:commit], - :scmid => changeset[:commit], - :author => changeset[:author], - :time => (changeset[:date] ? Time.parse(changeset[:date]) : nil), - :message => changeset[:description], - :paths => files - }) - - end - - get_rev('latest',path) if rev == [] - - return nil if $? && $?.exitstatus != 0 - return rev - end - def info - revs = revisions(url,nil,nil,{:limit => 1}) - if revs && revs.any? - Info.new(:root_url => url, :lastrev => revs.first) - else + begin + Info.new(:root_url => url, :lastrev => lastrev('',nil)) + rescue nil end - rescue Errno::ENOENT => e - return nil + end + + def branches + branches = [] + cmd = "#{GIT_BIN} --git-dir #{target('')} branch" + shellout(cmd) do |io| + io.each_line do |line| + branches << line.match('\s*\*?\s*(.*)$')[1] + end + end + branches.sort! + end + + def tags + tags = [] + cmd = "#{GIT_BIN} --git-dir #{target('')} tag" + shellout(cmd) do |io| + io.readlines.sort!.map{|t| t.strip} + end + end + + def default_branch + branches.include?('master') ? 'master' : branches.first end def entries(path=nil, identifier=nil) @@ -121,27 +69,63 @@ module Redmine sha = $2 size = $3 name = $4 + full_path = path.empty? ? name : "#{path}/#{name}" entries << Entry.new({:name => name, - :path => (path.empty? ? name : "#{path}/#{name}"), - :kind => ((type == "tree") ? 'dir' : 'file'), - :size => ((type == "tree") ? nil : size), - :lastrev => get_rev(identifier,(path.empty? ? name : "#{path}/#{name}")) - - }) unless entries.detect{|entry| entry.name == name} + :path => full_path, + :kind => (type == "tree") ? 'dir' : 'file', + :size => (type == "tree") ? nil : size, + :lastrev => lastrev(full_path,identifier) + }) unless entries.detect{|entry| entry.name == name} end end end return nil if $? && $?.exitstatus != 0 entries.sort_by_name end - + + def lastrev(path,rev) + return nil if path.nil? + cmd = "#{GIT_BIN} --git-dir #{target('')} log --pretty=fuller --no-merges -n 1 " + cmd << " #{shell_quote rev} " if rev + cmd << "-- #{path} " unless path.empty? + shellout(cmd) do |io| + begin + id = io.gets.split[1] + author = io.gets.match('Author:\s+(.*)$')[1] + 2.times { io.gets } + time = io.gets.match('CommitDate:\s+(.*)$')[1] + + Revision.new({ + :identifier => id, + :scmid => id, + :author => author, + :time => time, + :message => nil, + :paths => nil + }) + rescue NoMethodError => e + logger.error("The revision '#{path}' has a wrong format") + return nil + end + end + end + + def num_revisions + cmd = "#{GIT_BIN} --git-dir #{target('')} log --all --pretty=format:'' | wc -l" + shellout(cmd) {|io| io.gets.chomp.to_i + 1} + end + def revisions(path, identifier_from, identifier_to, options={}) revisions = Revisions.new - cmd = "#{GIT_BIN} --git-dir #{target('')} log --raw --date=iso --pretty=fuller" + + cmd = "#{GIT_BIN} --git-dir #{target('')} log --find-copies-harder --raw --date=iso --pretty=fuller" cmd << " --reverse" if options[:reverse] - cmd << " -n #{options[:limit].to_i} " if (!options.nil?) && options[:limit] + cmd << " --all" if options[:all] + cmd << " -n #{options[:limit]} " if options[:limit] cmd << " #{shell_quote(identifier_from + '..')} " if identifier_from cmd << " #{shell_quote identifier_to} " if identifier_to + cmd << " -- #{path}" if path && !path.empty? + shellout(cmd) do |io| files=[] changeset = {} @@ -154,13 +138,14 @@ module Redmine value = $1 if (parsing_descr == 1 || parsing_descr == 2) parsing_descr = 0 - revision = Revision.new({:identifier => changeset[:commit], - :scmid => changeset[:commit], - :author => changeset[:author], - :time => Time.parse(changeset[:date]), - :message => changeset[:description], - :paths => files - }) + revision = Revision.new({ + :identifier => changeset[:commit], + :scmid => changeset[:commit], + :author => changeset[:author], + :time => Time.parse(changeset[:date]), + :message => changeset[:description], + :paths => files + }) if block_given? yield revision else @@ -182,26 +167,35 @@ module Redmine elsif (parsing_descr == 0) && line.chomp.to_s == "" parsing_descr = 1 changeset[:description] = "" - elsif (parsing_descr == 1 || parsing_descr == 2) && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\s+(.+)$/ + elsif (parsing_descr == 1 || parsing_descr == 2) \ + && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\s+(.+)$/ parsing_descr = 2 fileaction = $1 filepath = $2 files << {:action => fileaction, :path => filepath} + elsif (parsing_descr == 1 || parsing_descr == 2) \ + && line =~ /^:\d+\s+\d+\s+[0-9a-f.]+\s+[0-9a-f.]+\s+(\w)\d+\s+(\S+)\s+(.+)$/ + parsing_descr = 2 + fileaction = $1 + filepath = $3 + files << {:action => fileaction, :path => filepath} elsif (parsing_descr == 1) && line.chomp.to_s == "" parsing_descr = 2 elsif (parsing_descr == 1) changeset[:description] << line[4..-1] end - end + end if changeset[:commit] - revision = Revision.new({:identifier => changeset[:commit], - :scmid => changeset[:commit], - :author => changeset[:author], - :time => Time.parse(changeset[:date]), - :message => changeset[:description], - :paths => files - }) + revision = Revision.new({ + :identifier => changeset[:commit], + :scmid => changeset[:commit], + :author => changeset[:author], + :time => Time.parse(changeset[:date]), + :message => changeset[:description], + :paths => files + }) + if block_given? yield revision else @@ -213,15 +207,16 @@ module Redmine return nil if $? && $?.exitstatus != 0 revisions end - + def diff(path, identifier_from, identifier_to=nil) path ||= '' - if !identifier_to - identifier_to = nil + + if identifier_to + cmd = "#{GIT_BIN} --git-dir #{target('')} diff #{shell_quote identifier_to} #{shell_quote identifier_from}" + else + cmd = "#{GIT_BIN} --git-dir #{target('')} show #{shell_quote identifier_from}" end - - cmd = "#{GIT_BIN} --git-dir #{target('')} show #{shell_quote identifier_from}" if identifier_to.nil? - cmd = "#{GIT_BIN} --git-dir #{target('')} diff #{shell_quote identifier_to} #{shell_quote identifier_from}" if !identifier_to.nil? + cmd << " -- #{shell_quote path}" unless path.empty? diff = [] shellout(cmd) do |io| @@ -265,6 +260,4 @@ module Redmine end end end - end - diff --git a/public/javascripts/repository_navigation.js b/public/javascripts/repository_navigation.js new file mode 100644 index 000000000..a40815f94 --- /dev/null +++ b/public/javascripts/repository_navigation.js @@ -0,0 +1,35 @@ +Event.observe(window,'load',function() { + /* + If we're viewing a tag or branch, don't display it in the + revision box + */ + var branch_selected = $('branch') && $('rev').getValue() == $('branch').getValue(); + var tag_selected = $('tag') && $('rev').getValue() == $('tag').getValue(); + if (branch_selected || tag_selected) { + $('rev').setValue(''); + } + + /* + Copy the branch/tag value into the revision box, then disable + the dropdowns before submitting the form + */ + $$('#branch,#tag').each(function(e) { + e.observe('change',function(e) { + $('rev').setValue(e.element().getValue()); + $$('#branch,#tag').invoke('disable'); + e.element().parentNode.submit(); + $$('#branch,#tag').invoke('enable'); + }); + }); + + /* + Disable the branch/tag dropdowns before submitting the revision form + */ + $('rev').observe('keydown', function(e) { + if (e.keyCode == 13) { + $$('#branch,#tag').invoke('disable'); + e.element().parentNode.submit(); + $$('#branch,#tag').invoke('enable'); + } + }); +}) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 970b3c437..02e3870b3 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -181,7 +181,7 @@ div.square { width: .6em; height: .6em; } .contextual {float:right; white-space: nowrap; line-height:1.4em;margin-top:5px; padding-left: 10px; font-size:0.9em;} -.contextual input {font-size:0.9em;} +.contextual input,select {font-size:0.9em;} .message .contextual { margin-top: 0; } .splitcontentleft{float:left; width:49%;} diff --git a/test/fixtures/repositories/git_repository.tar.gz b/test/fixtures/repositories/git_repository.tar.gz index 84de88aa7d08d0f58ba6f07bcc4b876fcaab23a3..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plj@i_YS4#nlD)RWP(&T?K8|XwaZRg9Z&6G-%MEL4yVj8Z>Coph1HM4H`6P b(4aws1`QfCXwaZR^LPFaIec>z0LTCUkCs 3 + get :show, :id => 3 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal 2, assigns(:entries).size assert assigns(:entries).detect {|e| e.name == 'directory' && e.kind == 'dir'} @@ -55,9 +55,9 @@ class RepositoriesBazaarControllerTest < Test::Unit::TestCase end def test_browse_directory - get :browse, :id => 3, :path => ['directory'] + get :show, :id => 3, :path => ['directory'] assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['doc-ls.txt', 'document.txt', 'edit.png'], assigns(:entries).collect(&:name) entry = assigns(:entries).detect {|e| e.name == 'edit.png'} @@ -67,9 +67,9 @@ class RepositoriesBazaarControllerTest < Test::Unit::TestCase end def test_browse_at_given_revision - get :browse, :id => 3, :path => [], :rev => 3 + get :show, :id => 3, :path => [], :rev => 3 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['directory', 'doc-deleted.txt', 'doc-ls.txt', 'doc-mkdir.txt'], assigns(:entries).collect(&:name) end @@ -102,7 +102,7 @@ class RepositoriesBazaarControllerTest < Test::Unit::TestCase def test_directory_entry get :entry, :id => 3, :path => ['directory'] assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entry) assert_equal 'directory', assigns(:entry).name end diff --git a/test/functional/repositories_cvs_controller_test.rb b/test/functional/repositories_cvs_controller_test.rb index 2207d6ab6..c728bf362 100644 --- a/test/functional/repositories_cvs_controller_test.rb +++ b/test/functional/repositories_cvs_controller_test.rb @@ -51,9 +51,9 @@ class RepositoriesCvsControllerTest < Test::Unit::TestCase end def test_browse_root - get :browse, :id => 1 + get :show, :id => 1 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal 3, assigns(:entries).size @@ -65,9 +65,9 @@ class RepositoriesCvsControllerTest < Test::Unit::TestCase end def test_browse_directory - get :browse, :id => 1, :path => ['images'] + get :show, :id => 1, :path => ['images'] assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['add.png', 'delete.png', 'edit.png'], assigns(:entries).collect(&:name) entry = assigns(:entries).detect {|e| e.name == 'edit.png'} @@ -78,9 +78,9 @@ class RepositoriesCvsControllerTest < Test::Unit::TestCase def test_browse_at_given_revision Project.find(1).repository.fetch_changesets - get :browse, :id => 1, :path => ['images'], :rev => 1 + get :show, :id => 1, :path => ['images'], :rev => 1 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['delete.png', 'edit.png'], assigns(:entries).collect(&:name) end @@ -118,7 +118,7 @@ class RepositoriesCvsControllerTest < Test::Unit::TestCase def test_directory_entry get :entry, :id => 1, :path => ['sources'] assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entry) assert_equal 'sources', assigns(:entry).name end diff --git a/test/functional/repositories_darcs_controller_test.rb b/test/functional/repositories_darcs_controller_test.rb index 8f1c7df98..3f841e9a1 100644 --- a/test/functional/repositories_darcs_controller_test.rb +++ b/test/functional/repositories_darcs_controller_test.rb @@ -45,9 +45,9 @@ class RepositoriesDarcsControllerTest < Test::Unit::TestCase end def test_browse_root - get :browse, :id => 3 + get :show, :id => 3 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal 3, assigns(:entries).size assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'} @@ -56,9 +56,9 @@ class RepositoriesDarcsControllerTest < Test::Unit::TestCase end def test_browse_directory - get :browse, :id => 3, :path => ['images'] + get :show, :id => 3, :path => ['images'] assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['delete.png', 'edit.png'], assigns(:entries).collect(&:name) entry = assigns(:entries).detect {|e| e.name == 'edit.png'} @@ -69,9 +69,9 @@ class RepositoriesDarcsControllerTest < Test::Unit::TestCase def test_browse_at_given_revision Project.find(3).repository.fetch_changesets - get :browse, :id => 3, :path => ['images'], :rev => 1 + get :show, :id => 3, :path => ['images'], :rev => 1 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['delete.png'], assigns(:entries).collect(&:name) end diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb index 7f63ea3a9..6c2502f51 100644 --- a/test/functional/repositories_git_controller_test.rb +++ b/test/functional/repositories_git_controller_test.rb @@ -46,22 +46,37 @@ class RepositoriesGitControllerTest < Test::Unit::TestCase end def test_browse_root - get :browse, :id => 3 + get :show, :id => 3 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) - assert_equal 3, assigns(:entries).size + assert_equal 6, assigns(:entries).size assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'} assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'} assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'} + assert assigns(:entries).detect {|e| e.name == 'copied_README' && e.kind == 'file'} + assert assigns(:entries).detect {|e| e.name == 'new_file.txt' && e.kind == 'file'} + assert assigns(:entries).detect {|e| e.name == 'renamed_test.txt' && e.kind == 'file'} end - - def test_browse_directory - get :browse, :id => 3, :path => ['images'] + + def test_browse_branch + get :show, :id => 3, :rev => 'test_branch' assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) - assert_equal ['delete.png', 'edit.png'], assigns(:entries).collect(&:name) + assert_equal 4, assigns(:entries).size + assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'} + assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'} + assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'} + assert assigns(:entries).detect {|e| e.name == 'test.txt' && e.kind == 'file'} + end + + def test_browse_directory + get :show, :id => 3, :path => ['images'] + assert_response :success + assert_template 'show' + assert_not_nil assigns(:entries) + assert_equal ['edit.png'], assigns(:entries).collect(&:name) entry = assigns(:entries).detect {|e| e.name == 'edit.png'} assert_not_nil entry assert_equal 'file', entry.kind @@ -69,9 +84,9 @@ class RepositoriesGitControllerTest < Test::Unit::TestCase end def test_browse_at_given_revision - get :browse, :id => 3, :path => ['images'], :rev => '7234cb2750b63f47bff735edc50a1c0a433c2518' + get :show, :id => 3, :path => ['images'], :rev => '7234cb2750b63f47bff735edc50a1c0a433c2518' assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['delete.png'], assigns(:entries).collect(&:name) end @@ -89,7 +104,7 @@ class RepositoriesGitControllerTest < Test::Unit::TestCase assert_template 'entry' # Line 19 assert_tag :tag => 'th', - :content => /10/, + :content => /11/, :attributes => { :class => /line-num/ }, :sibling => { :tag => 'td', :content => /WITHOUT ANY WARRANTY/ } end @@ -104,7 +119,7 @@ class RepositoriesGitControllerTest < Test::Unit::TestCase def test_directory_entry get :entry, :id => 3, :path => ['sources'] assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entry) assert_equal 'sources', assigns(:entry).name end @@ -127,14 +142,14 @@ class RepositoriesGitControllerTest < Test::Unit::TestCase assert_response :success assert_template 'annotate' # Line 23, changeset 2f9c0091 - assert_tag :tag => 'th', :content => /23/, + assert_tag :tag => 'th', :content => /24/, :sibling => { :tag => 'td', :child => { :tag => 'a', :content => /2f9c0091/ } }, :sibling => { :tag => 'td', :content => /jsmith/ }, :sibling => { :tag => 'td', :content => /watcher =/ } end def test_annotate_binary_file - get :annotate, :id => 3, :path => ['images', 'delete.png'] + get :annotate, :id => 3, :path => ['images', 'edit.png'] assert_response 500 assert_tag :tag => 'div', :attributes => { :class => /error/ }, :content => /can not be annotated/ diff --git a/test/functional/repositories_mercurial_controller_test.rb b/test/functional/repositories_mercurial_controller_test.rb index 53cbedd00..ec2526550 100644 --- a/test/functional/repositories_mercurial_controller_test.rb +++ b/test/functional/repositories_mercurial_controller_test.rb @@ -44,10 +44,10 @@ class RepositoriesMercurialControllerTest < Test::Unit::TestCase assert_not_nil assigns(:changesets) end - def test_browse_root - get :browse, :id => 3 + def test_show_root + get :show, :id => 3 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal 3, assigns(:entries).size assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'} @@ -55,10 +55,10 @@ class RepositoriesMercurialControllerTest < Test::Unit::TestCase assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'} end - def test_browse_directory - get :browse, :id => 3, :path => ['images'] + def test_show_directory + get :show, :id => 3, :path => ['images'] assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['delete.png', 'edit.png'], assigns(:entries).collect(&:name) entry = assigns(:entries).detect {|e| e.name == 'edit.png'} @@ -67,10 +67,10 @@ class RepositoriesMercurialControllerTest < Test::Unit::TestCase assert_equal 'images/edit.png', entry.path end - def test_browse_at_given_revision - get :browse, :id => 3, :path => ['images'], :rev => 0 + def test_show_at_given_revision + get :show, :id => 3, :path => ['images'], :rev => 0 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['delete.png'], assigns(:entries).collect(&:name) end @@ -103,7 +103,7 @@ class RepositoriesMercurialControllerTest < Test::Unit::TestCase def test_directory_entry get :entry, :id => 3, :path => ['sources'] assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entry) assert_equal 'sources', assigns(:entry).name end diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb index e31094e7b..ac1438572 100644 --- a/test/functional/repositories_subversion_controller_test.rb +++ b/test/functional/repositories_subversion_controller_test.rb @@ -47,18 +47,18 @@ class RepositoriesSubversionControllerTest < Test::Unit::TestCase end def test_browse_root - get :browse, :id => 1 + get :show, :id => 1 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) entry = assigns(:entries).detect {|e| e.name == 'subversion_test'} assert_equal 'dir', entry.kind end def test_browse_directory - get :browse, :id => 1, :path => ['subversion_test'] + get :show, :id => 1, :path => ['subversion_test'] assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['folder', '.project', 'helloworld.c', 'textfile.txt'], assigns(:entries).collect(&:name) entry = assigns(:entries).detect {|e| e.name == 'helloworld.c'} @@ -68,9 +68,9 @@ class RepositoriesSubversionControllerTest < Test::Unit::TestCase end def test_browse_at_given_revision - get :browse, :id => 1, :path => ['subversion_test'], :rev => 4 + get :show, :id => 1, :path => ['subversion_test'], :rev => 4 assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entries) assert_equal ['folder', '.project', 'helloworld.c', 'helloworld.rb', 'textfile.txt'], assigns(:entries).collect(&:name) end @@ -131,7 +131,7 @@ class RepositoriesSubversionControllerTest < Test::Unit::TestCase def test_directory_entry get :entry, :id => 1, :path => ['subversion_test', 'folder'] assert_response :success - assert_template 'browse' + assert_template 'show' assert_not_nil assigns(:entry) assert_equal 'folder', assigns(:entry).name end diff --git a/test/unit/git_adapter_test.rb b/test/unit/git_adapter_test.rb new file mode 100644 index 000000000..50bded062 --- /dev/null +++ b/test/unit/git_adapter_test.rb @@ -0,0 +1,22 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class GitAdapterTest < Test::Unit::TestCase + REPOSITORY_PATH = RAILS_ROOT.gsub(%r{config\/\.\.}, '') + '/tmp/test/git_repository' + + if File.directory?(REPOSITORY_PATH) + def setup + @adapter = Redmine::Scm::Adapters::GitAdapter.new(REPOSITORY_PATH) + end + + def test_branches + assert_equal @adapter.branches, ['master', 'test_branch'] + end + + def test_getting_all_revisions + assert_equal 12, @adapter.revisions('',nil,nil,:all => true).length + end + else + puts "Git test repository NOT FOUND. Skipping unit tests !!!" + def test_fake; assert true end + end +end diff --git a/test/unit/repository_git_test.rb b/test/unit/repository_git_test.rb index bc997b96c..382774305 100644 --- a/test/unit/repository_git_test.rb +++ b/test/unit/repository_git_test.rb @@ -34,8 +34,8 @@ class RepositoryGitTest < Test::Unit::TestCase @repository.fetch_changesets @repository.reload - assert_equal 6, @repository.changesets.count - assert_equal 11, @repository.changes.count + assert_equal 12, @repository.changesets.count + assert_equal 20, @repository.changes.count commit = @repository.changesets.find(:first, :order => 'committed_on ASC') assert_equal "Initial import.\nThe repository contains 3 files.", commit.comments @@ -57,10 +57,10 @@ class RepositoryGitTest < Test::Unit::TestCase # Remove the 3 latest changesets @repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy) @repository.reload - assert_equal 3, @repository.changesets.count + assert_equal 9, @repository.changesets.count @repository.fetch_changesets - assert_equal 6, @repository.changesets.count + assert_equal 12, @repository.changesets.count end else puts "Git test repository NOT FOUND. Skipping unit tests !!!"