hooks: handle non-ascii characters in hooks new pull-requests open template.

This commit is contained in:
Marcin Kuzminski 2018-12-27 11:27:40 +01:00
parent 03c420a9fc
commit 8e41ca4f0a

View file

@ -284,17 +284,16 @@ def post_push(extras):
output += _http_ret.title
if extras.new_refs:
tmpl = \
extras.server_url + '/' + \
extras.repository + \
"/pull-request/new?{ref_type}={ref_name}"
tmpl = extras.server_url + '/' + extras.repository + \
"/pull-request/new?{ref_type}={ref_name}"
for branch_name in extras.new_refs['branches']:
output += 'RhodeCode: open pull request link: {}\n'.format(
tmpl.format(ref_type='branch', ref_name=branch_name))
tmpl.format(ref_type='branch', ref_name=safe_str(branch_name)))
for book_name in extras.new_refs['bookmarks']:
output += 'RhodeCode: open pull request link: {}\n'.format(
tmpl.format(ref_type='bookmark', ref_name=book_name))
tmpl.format(ref_type='bookmark', ref_name=safe_str(book_name)))
hook_response = ''
if not is_shadow_repo(extras):