pushlog: convert unicode to str (bug 1268128); r?smacleod draft
authorGregory Szorc <gps@mozilla.com>
Wed, 27 Apr 2016 12:47:48 -0700
changeset 7933 8ff17b8b1167f7ac09a8de655da54292ca6710bd
parent 7932 4f0dd294022d01942fb597dd8b3453aef5600b1e
child 7934 f3bb9ffee126817e06bd3550899332c5b4b129a7
push id780
push usergszorc@mozilla.com
push dateWed, 27 Apr 2016 20:55:08 +0000
reviewerssmacleod
bugs1268128
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
hgext/pushlog/__init__.py
--- 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