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
0247a149c4
commit
25d642e0ea
|
@ -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