scm: mercurial: annotate accepts both of revision number and changeset id (#3724).

Change annotate revision label to Mercurial style '4:def6d2f1254a'
and use identifier.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4663 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA
2011-01-09 01:30:18 +00:00
parent 5207211b6d
commit ef28bf6d88
3 changed files with 29 additions and 9 deletions
@@ -71,6 +71,19 @@ begin
assert_nil @adapter.cat('sources/welcome_controller.rb')
end
def test_annotate
assert_equal [], @adapter.annotate("sources/welcome_controller.rb").lines
[2, '400bb8672109', '400', 400].each do |r|
ann = @adapter.annotate('sources/welcome_controller.rb', r)
assert ann
assert_equal '1', ann.revisions[17].revision
assert_equal '9d5b5b004199', ann.revisions[17].identifier
assert_equal 'jsmith', ann.revisions[0].author
assert_equal 25, ann.lines.length
assert_equal 'class WelcomeController < ApplicationController', ann.lines[17]
end
end
def test_access_by_nodeid
path = 'sources/welcome_controller.rb'
assert_equal @adapter.cat(path, 2), @adapter.cat(path, '400bb8672109')