Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/extensions/bin/createNightlies.py

Issue 5658647514316800: Issue 236 - Development build changelogs cannot deal with Unicode (Closed)
Patch Set: Created May 19, 2014, 4:32 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/extensions/bin/createNightlies.py
===================================================================
--- a/sitescripts/extensions/bin/createNightlies.py
+++ b/sitescripts/extensions/bin/createNightlies.py
@@ -68,19 +68,19 @@ class NightlyBuild(object):
return subprocess.check_output(command)
def getChanges(self):
"""
retrieve changes between the current and previous ("first") revision
"""
command = ['hg', 'log', '-R', self.config.repository, '-r', 'tip:0',
- '-b', 'default', '-l', '50',
+ '-b', 'default', '-l', '50', '--encoding', 'utf-8',
'--template', '{date|isodate}\\0{author|person}\\0{rev}\\0{desc}\\0\\0']
- result = subprocess.check_output(command)
+ result = subprocess.check_output(command).decode('utf-8')
for change in result.split('\0\0'):
if change:
date, author, revision, description = change.split('\0')
yield {'date': date, 'author': author, 'revision': revision, 'description': description}
def copyRepository(self):
'''
@@ -99,17 +99,17 @@ class NightlyBuild(object):
baseDir = os.path.join(self.config.nightliesDirectory, self.basename)
if not os.path.exists(baseDir):
os.makedirs(baseDir)
changelogFile = "%s-%s.changelog.xhtml" % (self.basename, self.version)
changelogPath = os.path.join(baseDir, changelogFile)
self.changelogURL = urlparse.urljoin(self.config.nightliesURL, self.basename + '/' + changelogFile)
template = get_template(get_config().get('extensions', 'changelogTemplate'))
- template.stream({'changes': changes}).dump(changelogPath)
+ template.stream({'changes': changes}).dump(changelogPath, encoding='utf-8')
linkPath = os.path.join(baseDir, '00latest.changelog.xhtml')
if hasattr(os, 'symlink'):
if os.path.exists(linkPath):
os.remove(linkPath)
os.symlink(os.path.basename(changelogPath), linkPath)
else:
shutil.copyfile(changelogPath, linkPath)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld