D4432: py3: do .decode(), .encode() dance in runtests.py

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Fri Aug 31 17:00:54 EDT 2018


pulkit updated this revision to Diff 10689.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4432?vs=10688&id=10689

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1352,7 +1352,9 @@
         if PYTHON3:
             session = session.encode('ascii')
         def toggletrace(cmd):
-            quoted = shellquote(cmd.strip()).replace(b'\\', b'\\\\')
+            cmd = cmd.decode('utf8')
+            quoted = shellquote(cmd.strip()).encode('utf8')
+            quoted = quoted.replace(b'\\', b'\\\\')
             if active:
                 script.append(
                     b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (



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


More information about the Mercurial-devel mailing list