D4444: tests: avoid shellquoting bytes on Python 3

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Sep 2 01:33:27 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGf57682dca1c1: tests: avoid shellquoting bytes on Python 3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4444?vs=10703&id=10711

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

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,11 @@
         if PYTHON3:
             session = session.encode('ascii')
         def toggletrace(cmd):
-            quoted = shellquote(cmd.strip()).replace(b'\\', b'\\\\')
+            if isinstance(cmd, str):
+                quoted = shellquote(cmd.strip())
+            else:
+                quoted = shellquote(cmd.strip().decode('utf8')).encode('utf8')
+            quoted = quoted.replace(b'\\', b'\\\\')
             if active:
                 script.append(
                     b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (



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


More information about the Mercurial-devel mailing list