py3: use unicode literals in changelog.py
authorPulkit Goyal <7895pulkit@gmail.com>
Thu, 04 Aug 2016 00:15:39 +0530
changeset 29696 2f64e5a6efb8
parent 29695 f2846d546645
child 29697 00269c6e4f6e
py3: use unicode literals in changelog.py collections.namedtuple type and field names must be str in Python 3. Our custom module importer was rewriting them to bytes literals, making this fail. In addition, __slots__ values must also be unicode.
mercurial/changelog.py
--- a/mercurial/changelog.py	Mon Jul 25 15:10:52 2016 +0200
+++ b/mercurial/changelog.py	Thu Aug 04 00:15:39 2016 +0530
@@ -138,9 +138,10 @@
         return appender(opener, name, mode, buf)
     return _delay
 
-_changelogrevision = collections.namedtuple('changelogrevision',
-                                            ('manifest', 'user', 'date',
-                                             'files', 'description', 'extra'))
+_changelogrevision = collections.namedtuple(u'changelogrevision',
+                                            (u'manifest', u'user', u'date',
+                                             u'files', u'description',
+                                             u'extra'))
 
 class changelogrevision(object):
     """Holds results of a parsed changelog revision.
@@ -151,8 +152,8 @@
     """
 
     __slots__ = (
-        '_offsets',
-        '_text',
+        u'_offsets',
+        u'_text',
     )
 
     def __new__(cls, text):