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

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Wed Jan 10 23:04:50 UTC 2018


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

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 = []



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


More information about the Mercurial-devel mailing list