Patchwork D1795: py3: use pycompat.bytestr() instead of str()

login
register
mail settings
Submitter phabricator
Date Jan. 10, 2018, 11:04 p.m.
Message ID <be6b276dcad38be01d7878d6a587cc31@localhost.localdomain>
Download mbox | patch
Permalink /patch/26666/
State Not Applicable
Headers show

Comments

phabricator - Jan. 10, 2018, 11:04 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG35fb3367f72d: py3: use pycompat.bytestr() instead of str() (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1795?vs=4672&id=4778

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

AFFECTED FILES
  mercurial/debugcommands.py
  mercurial/subrepo.py
  mercurial/verify.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -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:
diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -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
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -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 = []