py3: replace str(ctx) by bytes(ctx)
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 11 Jul 2019 14:46:17 -0700
changeset 4747 fa6aafa2857d
parent 4746 724c67878d98
child 4748 d04be27dcce9
py3: replace str(ctx) by bytes(ctx) These are all for messages to the user and we don't want unicode for that.
hgext3rd/evolve/__init__.py
hgext3rd/evolve/cmdrewrite.py
hgext3rd/evolve/evolvecmd.py
hgext3rd/evolve/obshistory.py
--- a/hgext3rd/evolve/__init__.py	Thu Jul 11 16:04:17 2019 -0700
+++ b/hgext3rd/evolve/__init__.py	Thu Jul 11 14:46:17 2019 -0700
@@ -1171,7 +1171,7 @@
     # making sure a next commit is formed
     if result[0] and result[1]:
         ui.status(_('working directory is now at %s\n')
-                  % ui.label(str(repo['.']), 'evolve.node'))
+                  % ui.label(bytes(repo['.']), 'evolve.node'))
     return 0
 
 def _updatetonext(ui, repo, child, displayer, opts):
--- a/hgext3rd/evolve/cmdrewrite.py	Thu Jul 11 16:04:17 2019 -0700
+++ b/hgext3rd/evolve/cmdrewrite.py	Thu Jul 11 14:46:17 2019 -0700
@@ -1119,7 +1119,7 @@
                     repo._bookmarks.applychanges(repo, tr, bmchanges)
                 commands.update(ui, repo, newnode.hex())
                 ui.status(_('working directory is now at %s\n')
-                          % ui.label(str(newnode), 'evolve.node'))
+                          % ui.label(bytes(newnode), 'evolve.node'))
                 if movebookmark:
                     bookmarksmod.activate(repo, bookactive)
 
--- a/hgext3rd/evolve/evolvecmd.py	Thu Jul 11 16:04:17 2019 -0700
+++ b/hgext3rd/evolve/evolvecmd.py	Thu Jul 11 14:46:17 2019 -0700
@@ -336,7 +336,7 @@
 
     # we don't handle split in content-divergence yet
     if len(others) > 1:
-        othersstr = "[%s]" % (','.join([str(i) for i in others]))
+        othersstr = "[%s]" % (','.join([bytes(i) for i in others]))
         msg = _("skipping %s: %s with a changeset that got split"
                 " into multiple ones:\n"
                 "|[%s]\n"
@@ -542,8 +542,8 @@
             return (res, newnode)
         if newnode == publicdiv.node():
             # case 2)
-            pubstr = str(publicdiv)
-            othstr = str(other)
+            pubstr = bytes(publicdiv)
+            othstr = bytes(other)
             msg = _('content divergence resolution between %s '
                     '(public) and %s has same content as %s, '
                     'discarding %s\n')
@@ -691,8 +691,8 @@
 
     if aspects:
         # warn user
-        locstr = str(local)
-        othstr = str(other)
+        locstr = bytes(local)
+        othstr = bytes(other)
         if 'close' in aspects:
             filteredasp = aspects - {'close'}
             if filteredasp:
@@ -1091,7 +1091,7 @@
         if 1 < len(revs):
             msg = "multiple evolve candidates"
             hint = (_("select one of %s with --rev")
-                    % ', '.join([str(repo[r]) for r in sorted(revs)]))
+                    % ', '.join([bytes(repo[r]) for r in sorted(revs)]))
             raise error.Abort(msg, hint=hint)
     elif instabilities_map.get(targetcat, targetcat) in repo['.'].instabilities():
         revs = set([repo['.'].rev()])
@@ -1849,7 +1849,7 @@
         immutable = [c for c in evolvedctx if not c.mutable()]
         if immutable:
             repo.ui.warn(_("cannot clean up public changesets: %s\n")
-                         % ', '.join(str(c) for c in immutable),
+                         % ', '.join(bytes(c) for c in immutable),
                          hint=_("see 'hg help phases' for details"))
             cleanup = False
 
--- a/hgext3rd/evolve/obshistory.py	Thu Jul 11 16:04:17 2019 -0700
+++ b/hgext3rd/evolve/obshistory.py	Thu Jul 11 14:46:17 2019 -0700
@@ -473,7 +473,7 @@
         shortdescription = shortdescription.splitlines()[0]
 
     fm.startitem()
-    fm.write('node', '%s', str(ctx),
+    fm.write('node', '%s', bytes(ctx),
              label="evolve.node")
     fm.plain(' ')