scm: mercurial: change identifier to revision in fetching revisions.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4847 e93f8b46-1217-0410-a6f0-8f06a7374b81
pull/351/head
Toshi MARUYAMA 14 years ago committed by Eric Davis
parent 608025fd04
commit 33f1436eb2
  1. 2
      app/models/repository/mercurial.rb
  2. 4
      lib/redmine/scm/adapters/mercurial_adapter.rb
  3. 6
      test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb

@ -112,7 +112,7 @@ class Repository::Mercurial < Repository
transaction do
revisions.each do |revision|
changeset = Changeset.create(:repository => self,
:revision => revision.identifier,
:revision => revision.revision,
:scmid => revision.scmid,
:committer => revision.author,
:committed_on => revision.time,

@ -150,12 +150,12 @@ module Redmine
end
paths.sort! { |x,y| x[:path] <=> y[:path] }
revisions << Revision.new({:identifier => logentry.attributes['revision'],
revisions << Revision.new({:revision => logentry.attributes['revision'],
:scmid => logentry.attributes['node'],
:author => (logentry.elements['author'] ? logentry.elements['author'].text : ""),
:time => Time.parse(logentry.elements['date'].text).localtime,
:message => logentry.elements['msg'].text,
:paths => paths
:paths => paths,
})
end
rescue

@ -55,14 +55,14 @@ begin
def test_revisions
revisions = @adapter.revisions(nil, 2, 4)
assert_equal 3, revisions.size
# assert_equal '2', revisions[0].revision
assert_equal '2', revisions[0].revision
assert_equal '400bb8672109', revisions[0].scmid
# assert_equal '4', revisions[2].revision
assert_equal '4', revisions[2].revision
assert_equal 'def6d2f1254a', revisions[2].scmid
revisions = @adapter.revisions(nil, 2, 4, {:limit => 2})
assert_equal 2, revisions.size
# assert_equal '2', revisions[0].revision
assert_equal '2', revisions[0].revision
assert_equal '400bb8672109', revisions[0].scmid
end

Loading…
Cancel
Save