Commit 944293bb authored by Toshi MARUYAMA's avatar Toshi MARUYAMA Committed by Eric Davis

scm: mercurial: support named branches at adapter (#7246).

Contributed by Yuya Nishihara.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4874 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent c60a9ee5
......@@ -97,6 +97,18 @@ module Redmine
Hash[*alist.flatten]
end
def branches
as_ary(summary['repository']['branch']).map { |e| e['name'] }
end
# Returns map of {'branch' => 'nodeid', ...}
def branchmap
alist = as_ary(summary['repository']['branch']).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']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment