Patchwork D7373: py3: pass a bytes value for "msg" to nouideprecwarn()

login
register
mail settings
Submitter phabricator
Date Nov. 13, 2019, 8:16 a.m.
Message ID <differential-rev-PHID-DREV-zddirdxrpcouvkkxbp5b-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43154/
State Superseded
Headers show

Comments

phabricator - Nov. 13, 2019, 8:16 a.m.
dlax created this revision.
Herald added a reviewer: indygreg.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D7373

AFFECTED FILES
  mercurial/pure/parsers.py
  mercurial/revlog.py

CHANGE DETAILS




To: dlax, indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 13, 2019, 8:17 a.m.
dlax added a comment.


  should fix tracebacks in https://ci.octobus.net/job/EvolvePy3/278/console

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7373/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7373

To: dlax, indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -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
 
diff --git a/mercurial/pure/parsers.py b/mercurial/pure/parsers.py
--- a/mercurial/pure/parsers.py
+++ b/mercurial/pure/parsers.py
@@ -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