py3: update changelog generation to use strings
gitea/eobuilder/pipeline/head Build started...
Details
gitea/eobuilder/pipeline/head Build started...
Details
This commit is contained in:
parent
1e9c8dba10
commit
5be937b645
|
@ -1,3 +1,4 @@
|
|||
import codecs
|
||||
import datetime
|
||||
import textwrap
|
||||
import os
|
||||
|
@ -66,7 +67,9 @@ def changelog_from_git(project, version_suffix, path,
|
|||
if i == n-1:
|
||||
logs = [commit] + list(commit.iter_parents())
|
||||
else:
|
||||
reflog = '%s..%s' % (versions[i+1][1].binsha.encode('hex'), commit.binsha.encode('hex'))
|
||||
def encode_hex(value):
|
||||
return codecs.encode(value, 'hex').decode('ascii')
|
||||
reflog = '%s..%s' % (encode_hex(versions[i+1][1].binsha), encode_hex(commit.binsha))
|
||||
logs = list(Commit.iter_items(repo, reflog))
|
||||
if not logs:
|
||||
continue
|
||||
|
@ -87,7 +90,7 @@ def changelog_from_git(project, version_suffix, path,
|
|||
t = '(%s) %s' % (l.hexsha[:6], e)
|
||||
lines = textwrap.wrap(t, 80)
|
||||
for prefix, suffix in zip([' * '] + [' ']*(len(lines)-1), lines):
|
||||
yield (prefix + suffix).encode('utf-8')
|
||||
yield (prefix + suffix)
|
||||
paris = pytz.timezone('Europe/Paris')
|
||||
date = datetime.datetime.fromtimestamp(logs[0].committed_date + logs[0].committer_tz_offset).replace(
|
||||
tzinfo=pytz.UTC).astimezone(paris).strftime('%a, %d %b %Y %H:%M:%S %z')
|
||||
|
|
Loading…
Reference in New Issue