[PATCH 6 of 8] py3: remove b'' from output of test-eol.t

Yuya Nishihara yuya at tcha.org
Sat Jun 16 07:06:12 EDT 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1529139269 -32400
#      Sat Jun 16 17:54:29 2018 +0900
# Node ID f701eb1d33ae7b9526742315b4f1d375ec016574
# Parent  bb0ed8255ed912ae146dd3f1f594ab3321025f48
py3: remove b'' from output of test-eol.t

diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -126,6 +126,7 @@ test-eol-hook.t
 test-eol-patch.t
 test-eol-tag.t
 test-eol-update.t
+test-eol.t
 test-excessive-merge.t
 test-exchange-obsmarkers-case-A1.t
 test-exchange-obsmarkers-case-A2.t
diff --git a/tests/test-eol.t b/tests/test-eol.t
--- a/tests/test-eol.t
+++ b/tests/test-eol.t
@@ -7,7 +7,7 @@ Test EOL extension
 
 Set up helpers
 
-  $ cat > switch-eol.py <<EOF
+  $ cat > switch-eol.py <<'EOF'
   > from __future__ import absolute_import
   > import os
   > import sys
@@ -17,8 +17,10 @@ Set up helpers
   >     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
   > except ImportError:
   >     pass
+  > eolmap = {b'\n': '\\n', b'\r\n': '\\r\\n'}
   > (old, new) = sys.argv[1] == 'LF' and (b'\n', b'\r\n') or (b'\r\n', b'\n')
-  > print("%% switching encoding from %r to %r" % (old, new))
+  > print("%% switching encoding from '%s' to '%s'"
+  >       % (eolmap[old], eolmap[new]))
   > for path in sys.argv[2:]:
   >     data = open(path, 'rb').read()
   >     data = data.replace(old, new)


More information about the Mercurial-devel mailing list