summaryrefslogtreecommitdiffstats
path: root/lib/redmine/scm/adapters/mercurial_adapter.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-18 07:14:51 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-02-18 07:14:51 +0000
commit25d642e0eafecc088949b61f18d547fab352a810 (patch)
tree40cb63cf73e9636b77cdb750e77e1c714a765ae3 /lib/redmine/scm/adapters/mercurial_adapter.rb
parent0247a149c43cb88b2ba16151dd8b2b9842dd27ad (diff)
downloadredmine-25d642e0eafecc088949b61f18d547fab352a810.tar.gz
redmine-25d642e0eafecc088949b61f18d547fab352a810.zip
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
Diffstat (limited to 'lib/redmine/scm/adapters/mercurial_adapter.rb')
-rw-r--r--lib/redmine/scm/adapters/mercurial_adapter.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb
index 28f551574..e8531e612 100644
--- a/lib/redmine/scm/adapters/mercurial_adapter.rb
+++ b/lib/redmine/scm/adapters/mercurial_adapter.rb
@@ -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']