@@ -58,7 +58,7 class Repository::Mercurial < Repository | |||||
58 | # Returns the latest changesets for +path+; sorted by revision number |
|
58 | # Returns the latest changesets for +path+; sorted by revision number | |
59 | def latest_changesets(path, rev, limit=10) |
|
59 | def latest_changesets(path, rev, limit=10) | |
60 | if path.blank? |
|
60 | if path.blank? | |
61 | changesets.find(:all, :include => :user, :limit => limit) |
|
61 | changesets.find(:all, :include => :user, :limit => limit, :order => "id DESC") | |
62 | else |
|
62 | else | |
63 | changes.find(:all, :include => {:changeset => :user}, |
|
63 | changes.find(:all, :include => {:changeset => :user}, | |
64 | :conditions => ["path = ?", path.with_leading_slash], |
|
64 | :conditions => ["path = ?", path.with_leading_slash], |
@@ -87,7 +87,8 class RepositoryMercurialTest < ActiveSupport::TestCase | |||||
87 |
|
87 | |||
88 | # with_limit |
|
88 | # with_limit | |
89 | changesets = @repository.latest_changesets('', nil, 2) |
|
89 | changesets = @repository.latest_changesets('', nil, 2) | |
90 | assert_equal @repository.latest_changesets('', nil)[0, 2], changesets |
|
90 | # assert_equal @repository.latest_changesets('', nil)[0, 2], changesets | |
|
91 | assert_equal %w|16 15|, changesets.collect(&:revision) | |||
91 |
|
92 | |||
92 | # with_filepath |
|
93 | # with_filepath | |
93 | changesets = @repository.latest_changesets('/sql_escape/percent%dir/percent%file1.txt', nil) |
|
94 | changesets = @repository.latest_changesets('/sql_escape/percent%dir/percent%file1.txt', nil) |
General Comments 0
You need to be logged in to leave comments.
Login now