py3: use pycompat.bytestr() instead of str()
authorPulkit Goyal <7895pulkit@gmail.com>
Fri, 29 Dec 2017 05:29:04 +0530
changeset 35585 35fb3367f72d
parent 35584 6f62a1c3e11d
child 35586 fbf1a5d680ea
py3: use pycompat.bytestr() instead of str() Differential Revision: https://phab.mercurial-scm.org/D1795
mercurial/debugcommands.py
mercurial/subrepo.py
mercurial/verify.py
--- a/mercurial/debugcommands.py	Fri Dec 29 05:28:05 2017 +0530
+++ b/mercurial/debugcommands.py	Fri Dec 29 05:29:04 2017 +0530
@@ -180,7 +180,7 @@
         ui.progress(_('building'), id, unit=_('revisions'), total=total)
         for type, data in dagparser.parsedag(text):
             if type == 'n':
-                ui.note(('node %s\n' % str(data)))
+                ui.note(('node %s\n' % pycompat.bytestr(data)))
                 id, ps = data
 
                 files = []
--- a/mercurial/subrepo.py	Fri Dec 29 05:28:05 2017 +0530
+++ b/mercurial/subrepo.py	Fri Dec 29 05:29:04 2017 +0530
@@ -389,14 +389,14 @@
     if util.safehasattr(repo, '_subparent'):
         source = util.url(repo._subsource)
         if source.isabs():
-            return str(source)
+            return pycompat.bytestr(source)
         source.path = posixpath.normpath(source.path)
         parent = _abssource(repo._subparent, push, abort=False)
         if parent:
             parent = util.url(util.pconvert(parent))
             parent.path = posixpath.join(parent.path or '', source.path)
             parent.path = posixpath.normpath(parent.path)
-            return str(parent)
+            return pycompat.bytestr(parent)
     else: # recursion reached top repo
         if util.safehasattr(repo, '_subtoppath'):
             return repo._subtoppath
--- a/mercurial/verify.py	Fri Dec 29 05:28:05 2017 +0530
+++ b/mercurial/verify.py	Fri Dec 29 05:29:04 2017 +0530
@@ -17,6 +17,7 @@
 
 from . import (
     error,
+    pycompat,
     revlog,
     scmutil,
     util,
@@ -105,7 +106,8 @@
                                     if self.lrugetctx(l)[f].filenode() == node]
                     except Exception:
                         pass
-                self.warn(_(" (expected %s)") % " ".join(map(str, linkrevs)))
+                self.warn(_(" (expected %s)") % " ".join
+                          (map(pycompat.bytestr, linkrevs)))
             lr = None # can't be trusted
 
         try: