scm: mercurial: support tags at adapter (#1981).
Contributed by Yuya Nishihara. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4872 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
b2e4dbca6f
commit
0cdbec47b5
|
@ -85,6 +85,18 @@ module Redmine
|
|||
:scmid => tip['node']))
|
||||
end
|
||||
|
||||
def tags
|
||||
as_ary(summary['repository']['tag']).map { |e| e['name'] }
|
||||
end
|
||||
|
||||
# Returns map of {'tag' => 'nodeid', ...}
|
||||
def tagmap
|
||||
alist = as_ary(summary['repository']['tag']).map do |e|
|
||||
e.values_at('name', 'node')
|
||||
end
|
||||
Hash[*alist.flatten]
|
||||
end
|
||||
|
||||
def summary
|
||||
@summary ||= hg 'rhsummary' do |io|
|
||||
ActiveSupport::XmlMini.parse(io.read)['rhsummary']
|
||||
|
|
Loading…
Reference in New Issue