summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-08 16:06:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-12-08 16:06:22 +0000
commit517a87f8c52e121ae213490bacc5810208bf4152 (patch)
tree18d27ecc7ac4b275e7a841ee76e1888803bd5486
parentefeebd427875707b8f625ed091f80a19d94c0db9 (diff)
downloadredmine-517a87f8c52e121ae213490bacc5810208bf4152.tar.gz
redmine-517a87f8c52e121ae213490bacc5810208bf4152.zip
Fixed: Subversion#latest_changesets ignores revision argument (#4360).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3134 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/repository/subversion.rb2
-rw-r--r--test/unit/repository_subversion_test.rb18
2 files changed, 12 insertions, 8 deletions
diff --git a/app/models/repository/subversion.rb b/app/models/repository/subversion.rb
index 86ac5a921..0f9b56746 100644
--- a/app/models/repository/subversion.rb
+++ b/app/models/repository/subversion.rb
@@ -31,7 +31,7 @@ class Repository::Subversion < Repository
end
def latest_changesets(path, rev, limit=10)
- revisions = scm.revisions(path, nil, nil, :limit => limit)
+ revisions = scm.revisions(path, rev, nil, :limit => limit)
revisions ? changesets.find_all_by_revision(revisions.collect(&:identifier), :order => "committed_on DESC", :include => :user) : []
end
diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb
index f0ad212ca..fb5580c42 100644
--- a/test/unit/repository_subversion_test.rb
+++ b/test/unit/repository_subversion_test.rb
@@ -49,17 +49,21 @@ class RepositorySubversionTest < ActiveSupport::TestCase
assert_equal 10, @repository.changesets.count
end
- def test_latest_changesets_with_limit
+ def test_latest_changesets
@repository.fetch_changesets
+
+ # with limit
changesets = @repository.latest_changesets('', nil, 2)
assert_equal 2, changesets.size
assert_equal @repository.latest_changesets('', nil).slice(0,2), changesets
- end
-
- def test_latest_changesets_with_path
- @repository.fetch_changesets
- changesets = @repository.latest_changesets('subversion_test/folder/helloworld.rb', nil)
- assert_equal %w(6 3 2), changesets.collect(&:revision)
+
+ # with path
+ changesets = @repository.latest_changesets('subversion_test/folder', nil)
+ assert_equal ["10", "9", "7", "6", "5", "2"], changesets.collect(&:revision)
+
+ # with path and revision
+ changesets = @repository.latest_changesets('subversion_test/folder', 8)
+ assert_equal ["7", "6", "5", "2"], changesets.collect(&:revision)
end
else
puts "Subversion test repository NOT FOUND. Skipping unit tests !!!"