1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-14 09:36:21 +01:00

fix get_commitlog to decode correct.

get_commitlog mixes bytes and strings when the output is
xml or csv.

This is fixed by decoding the commit message before replacing chars.
This commit is contained in:
lethliel 2019-05-14 10:01:02 +02:00
parent c5139fdff8
commit 03777b7e4d

View File

@ -6330,7 +6330,7 @@ def get_commitlog(apiurl, prj, package, revision, format = 'text', meta = False,
if format == 'csv':
s = '%s|%s|%s|%s|%s|%s|%s' % (rev, user, t, srcmd5, version,
comment.replace('\\', '\\\\').replace('\n', '\\n').replace('|', '\\|'), requestid)
decode_it(comment).replace('\\', '\\\\').replace('\n', '\\n').replace('|', '\\|'), requestid)
r.append(s)
elif format == 'xml':
r.append('<logentry')
@ -6339,7 +6339,7 @@ def get_commitlog(apiurl, prj, package, revision, format = 'text', meta = False,
r.append('<date>%s</date>' % t)
r.append('<requestid>%s</requestid>' % requestid)
r.append('<msg>%s</msg>' %
comment.replace('&', '&amp;').replace('<', '&gt;').replace('>', '&lt;'))
decode_it(comment).replace('&', '&amp;').replace('<', '&gt;').replace('>', '&lt;'))
r.append('</logentry>')
else:
if requestid: