global: use raw strings for namedtuple()
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 02 Mar 2019 12:57:00 -0800
changeset 41834 7f63ec6969f3
parent 41833 89f01ea906ae
child 41835 ddb174511f1b
global: use raw strings for namedtuple() Otherwise Python 2 will attempt to coerce unicode to str, which we don't want. Differential Revision: https://phab.mercurial-scm.org/D6049
hgext/journal.py
mercurial/util.py
--- a/hgext/journal.py	Sat Mar 02 12:55:29 2019 -0800
+++ b/hgext/journal.py	Sat Mar 02 12:57:00 2019 -0800
@@ -194,8 +194,8 @@
     return orig(ui, repo, repopath)
 
 class journalentry(collections.namedtuple(
-        u'journalentry',
-        u'timestamp user command namespace name oldhashes newhashes')):
+        r'journalentry',
+        r'timestamp user command namespace name oldhashes newhashes')):
     """Individual journal entry
 
     * timestamp: a mercurial (time, timezone) tuple
--- a/mercurial/util.py	Sat Mar 02 12:55:29 2019 -0800
+++ b/mercurial/util.py	Sat Mar 02 12:57:00 2019 -0800
@@ -3211,9 +3211,9 @@
 SERVERROLE = 'server'
 CLIENTROLE = 'client'
 
-compewireprotosupport = collections.namedtuple(u'compenginewireprotosupport',
-                                               (u'name', u'serverpriority',
-                                                u'clientpriority'))
+compewireprotosupport = collections.namedtuple(r'compenginewireprotosupport',
+                                               (r'name', r'serverpriority',
+                                                r'clientpriority'))
 
 class compressormanager(object):
     """Holds registrations of various compression engines.