pushlog: convert unicode to str (
bug 1268128); r?smacleod
SQLite returns unicode instances. Mercurial deals with str everywhere
internally. Convert the node value to str so we're consistent.
This doesn't fix
bug 1268128, but it does contribute to mixed
str and unicode, which is never a good thing.
MozReview-Commit-ID: ClTA6HgdaDj
--- a/hgext/pushlog/__init__.py
+++ b/hgext/pushlog/__init__.py
@@ -371,17 +371,17 @@ class pushlog(object):
pushid = res[0]
res = c.execute('SELECT id, user, date, node from pushlog '
'LEFT JOIN changesets on id=pushid '
'WHERE id=? ORDER BY rev ASC', (pushid,))
nodes = []
for pushid, who, when, node in res:
who = who.encode('utf-8')
- nodes.append(node)
+ nodes.append(node.encode('ascii'))
return pushid, who, when, nodes
def verify(self):
# Attempt to create database (since .pushes below won't).
with self.conn():
pass