py3: pass a bytes value for "msg" to nouideprecwarn()
authorDenis Laxalde <denis.laxalde@logilab.fr>
Wed, 13 Nov 2019 09:09:42 +0100
changeset 43619 c207c46a86b9
parent 43618 c5f6f58f6c71
child 43620 dd773340a085
py3: pass a bytes value for "msg" to nouideprecwarn() That function formats "msg" with the "version" value. On Python 3, this leads to "TypeError: can only concatenate str (not "bytes") to str". Also eliminate spurious strings concatenation in single-line declarations. Differential Revision: https://phab.mercurial-scm.org/D7373
mercurial/pure/parsers.py
mercurial/revlog.py
--- a/mercurial/pure/parsers.py	Tue Nov 12 15:53:58 2019 -0800
+++ b/mercurial/pure/parsers.py	Wed Nov 13 09:09:42 2019 +0100
@@ -49,7 +49,7 @@
 class BaseIndexObject(object):
     @property
     def nodemap(self):
-        msg = "index.nodemap is deprecated, " "use index.[has_node|rev|get_rev]"
+        msg = b"index.nodemap is deprecated, use index.[has_node|rev|get_rev]"
         util.nouideprecwarn(msg, b'5.3', stacklevel=2)
         return self._nodemap
 
--- a/mercurial/revlog.py	Tue Nov 12 15:53:58 2019 -0800
+++ b/mercurial/revlog.py	Wed Nov 13 09:09:42 2019 +0100
@@ -207,7 +207,7 @@
 class revlogoldindex(list):
     @property
     def nodemap(self):
-        msg = "index.nodemap is deprecated, " "use index.[has_node|rev|get_rev]"
+        msg = b"index.nodemap is deprecated, use index.[has_node|rev|get_rev]"
         util.nouideprecwarn(msg, b'5.3', stacklevel=2)
         return self._nodemap
 
@@ -657,15 +657,15 @@
     @property
     def nodemap(self):
         msg = (
-            "revlog.nodemap is deprecated, "
-            "use revlog.index.[has_node|rev|get_rev]"
+            b"revlog.nodemap is deprecated, "
+            b"use revlog.index.[has_node|rev|get_rev]"
         )
         util.nouideprecwarn(msg, b'5.3', stacklevel=2)
         return self.index.nodemap
 
     @property
     def _nodecache(self):
-        msg = "revlog._nodecache is deprecated, use revlog.index.nodemap"
+        msg = b"revlog._nodecache is deprecated, use revlog.index.nodemap"
         util.nouideprecwarn(msg, b'5.3', stacklevel=2)
         return self.index.nodemap