tests/test-annotate.t
changeset 36760 7bf80d9d9543
parent 36690 b529e640015d
parent 36698 52b344e977b7
child 36827 12492794bf8c
--- a/tests/test-annotate.t	Sun Mar 04 21:16:36 2018 -0500
+++ b/tests/test-annotate.t	Tue Mar 06 14:32:14 2018 -0800
@@ -903,9 +903,15 @@
   $ hg init repo-cr
   $ cd repo-cr
 
-  $ substcr() {
-  > sed 's/\r/[CR]/g'
-  > }
+  $ cat <<'EOF' >> "$TESTTMP/substcr.py"
+  > import sys
+  > from mercurial import util
+  > util.setbinary(sys.stdin)
+  > util.setbinary(sys.stdout)
+  > stdin = getattr(sys.stdin, 'buffer', sys.stdin)
+  > stdout = getattr(sys.stdout, 'buffer', sys.stdout)
+  > stdout.write(stdin.read().replace(b'\r', b'[CR]'))
+  > EOF
 
   >>> with open('a', 'wb') as f:
   ...     f.write(b'0a\r0b\r\n0c\r0d\r\n0e\n0f\n0g')
@@ -914,13 +920,13 @@
   ...     f.write(b'0a\r0b\r\n1c\r1d\r\n0e\n1f\n0g')
   $ hg ci -m1
 
-  $ hg annotate -r0 a | substcr
+  $ hg annotate -r0 a | $PYTHON "$TESTTMP/substcr.py"
   0: 0a[CR]0b[CR]
   0: 0c[CR]0d[CR]
   0: 0e
   0: 0f
   0: 0g
-  $ hg annotate -r1 a | substcr
+  $ hg annotate -r1 a | $PYTHON "$TESTTMP/substcr.py"
   0: 0a[CR]0b[CR]
   1: 1c[CR]1d[CR]
   0: 0e