diff options
-rw-r--r-- | lib/redmine/scm/adapters/mercurial/redminehelper.py | 4 | ||||
-rw-r--r-- | lib/redmine/scm/adapters/mercurial_adapter.rb | 18 |
2 files changed, 12 insertions, 10 deletions
diff --git a/lib/redmine/scm/adapters/mercurial/redminehelper.py b/lib/redmine/scm/adapters/mercurial/redminehelper.py index 8097d905a..c187df8c2 100644 --- a/lib/redmine/scm/adapters/mercurial/redminehelper.py +++ b/lib/redmine/scm/adapters/mercurial/redminehelper.py @@ -85,7 +85,7 @@ def _tags(ui, repo): except error.LookupError: continue ui.write('<tag revision="%d" node="%s" name="%s"/>\n' - % (r, _x(node.hex(n)), _x(t))) + % (r, _x(node.hex(n)), _u(t))) def _branches(ui, repo): # see mercurial/commands.py:branches @@ -110,7 +110,7 @@ def _branches(ui, repo): for t, n, r in sorted(iterbranches(), key=lambda e: e[2], reverse=True): if lookup(r, n) in branchheads(t): ui.write('<branch revision="%d" node="%s" name="%s"/>\n' - % (r, _x(node.hex(n)), _x(t))) + % (r, _x(node.hex(n)), _u(t))) def _manifest(ui, repo, path, rev): ctx = _changectx(repo, rev) diff --git a/lib/redmine/scm/adapters/mercurial_adapter.rb b/lib/redmine/scm/adapters/mercurial_adapter.rb index f07bf0cfc..a81763c5b 100644 --- a/lib/redmine/scm/adapters/mercurial_adapter.rb +++ b/lib/redmine/scm/adapters/mercurial_adapter.rb @@ -97,21 +97,22 @@ module Redmine end def tags - as_ary(summary['repository']['tag']).map { |e| e['name'] } + as_ary(summary['repository']['tag']).map {|e| CGI.unescape(e['name'])} end # Returns map of {'tag' => 'nodeid', ...} def tagmap - alist = as_ary(summary['repository']['tag']).map do |e| - e.values_at('name', 'node') + map = {} + as_ary(summary['repository']['tag']).each do |e| + map[CGI.unescape(e['name'])] = e['node'] end - Hash[*alist.flatten] + map end def branches brs = [] as_ary(summary['repository']['branch']).each do |e| - br = Branch.new(e['name']) + br = Branch.new(CGI.unescape(e['name'])) br.revision = e['revision'] br.scmid = e['node'] brs << br @@ -121,10 +122,11 @@ module Redmine # Returns map of {'branch' => 'nodeid', ...} def branchmap - alist = as_ary(summary['repository']['branch']).map do |e| - e.values_at('name', 'node') + map = {} + branches.each do |b| + map[b.to_s] = b.scmid end - Hash[*alist.flatten] + map end def summary |