scm: mercurial: wrap revison, tag and branch with URL encoding for entries (#4455, #1981, #7246).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4989 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-03-02 10:17:36 +00:00
parent a79c89eb3c
commit c3e8fc5f1a
2 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ def rhmanifest(ui, repo, path='', **opts):
ui.write('<rhmanifest>\n') ui.write('<rhmanifest>\n')
ui.write('<repository root="%s">\n' % _u(repo.root)) ui.write('<repository root="%s">\n' % _u(repo.root))
try: try:
_manifest(ui, repo, urllib.unquote_plus(path), opts.get('rev')) _manifest(ui, repo, urllib.unquote_plus(path), urllib.unquote_plus(opts.get('rev')))
finally: finally:
ui.write('</repository>\n') ui.write('</repository>\n')
ui.write('</rhmanifest>\n') ui.write('</rhmanifest>\n')

View File

@ -130,7 +130,7 @@ module Redmine
def entries(path=nil, identifier=nil) def entries(path=nil, identifier=nil)
p1 = scm_iconv(@path_encoding, 'UTF-8', path) p1 = scm_iconv(@path_encoding, 'UTF-8', path)
manifest = hg('rhmanifest', '-r', hgrev(identifier), manifest = hg('rhmanifest', '-r', CGI.escape(hgrev(identifier)),
CGI.escape(without_leading_slash(p1.to_s))) do |io| CGI.escape(without_leading_slash(p1.to_s))) do |io|
begin begin
ActiveSupport::XmlMini.parse(io.read)['rhmanifest']['repository']['manifest'] ActiveSupport::XmlMini.parse(io.read)['rhmanifest']['repository']['manifest']