changeset 12943:7439ea4146f8 stable

tests: use (esc) instead of other kinds of string escaping
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 08 Nov 2010 01:41:42 +0100
parents 05fffd665170
children fc069544f1af 6878eaa5a40d
files tests/printrepr.py tests/test-convert-darcs.t tests/test-convert-svn-encoding.t tests/test-eol-add.t tests/test-eol-clone.t tests/test-eol-patch.t tests/test-eol-update.t tests/test-eol.t tests/test-git-import.t tests/test-hgweb-commands.t tests/test-highlight.t tests/test-import-eol.t tests/test-simplemerge-cmd.t tests/test-transplant.t
diffstat 14 files changed, 264 insertions(+), 252 deletions(-) [+]
line wrap: on
line diff
--- a/tests/printrepr.py	Mon Nov 08 01:41:41 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
-#
-# This software may be used and distributed according to the terms of the
-# GNU General Public License version 2 or any later version.
-
-"""prints repr(sys.stdin) but preserves newlines in input"""
-
-import sys
-print repr(sys.stdin.read())[1:-1].replace('\\n', '\n'),
--- a/tests/test-convert-darcs.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-convert-darcs.t	Mon Nov 08 01:41:42 2010 +0100
@@ -117,11 +117,11 @@
 "c" file in p1.1 patch are reverted too.
 Just to say that manifest not listing "c" here is a bug.
 
-  $ HGENCODING=latin-1 glog -R darcs-repo-hg -r 6 | "$TESTDIR"/printrepr.py
-  o  6 "p5: desc \xc2\x80\xc2\x81\xc2\x82\xc2\x83\xc2\x84\xc2\x85\xc2\x86\xc2\x87\xc2\x88\xc2\x89\xc2\x8a\xc2\x8b\xc2\x8c\xc2\x8d\xc2\x8e\xc2\x8f\xc2\x90\xc2\x91\xc2\x92\xc2\x93\xc2\x94\xc2\x95\xc2\x96\xc2\x97\xc2\x98\xc2\x99\xc2\x9a\xc2\x9b\xc2\x9c\xc2\x9d\xc2\x9e\xc2\x9f\xc2\xa0\xc2\xa1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\xc2\xa1\xc2\xa2\xc2\xa3\xc2\xa4\xc2\xa5\xc2\xa6\xc2\xa7\xc2\xa8\xc2\xa9\xc2\xaa\xc2\xab\xc2\xac\xc2\xad\xc2\xae\xc2\xaf\xc2\xb0\xc2\xb1\xc2\xb2\xc2\xb3\xc2\xb4\xc2\xb5\xc2\xb6\xc2\xb7\xc2\xb8\xc2\xb9\xc2\xba\xc2\xbb\xc2\xbc\xc2\xbd\xc2\xbe\xc2\xbf\xc3\x80\xc3\x81\xc3\x82\xc3\x83\xc3\x84\xc3\x85\xc3\x86\xc3\x87\xc3\x88\xc3\x89\xc3\x8a\xc3\x8b\xc3\x8c\xc3\x8d\xc3\x8e\xc3\x8f\xc3\x90\xc3\x91\xc3\x92\xc3\x93\xc3\x94\xc3\x95\xc3\x96\xc3\x97\xc3\x98\xc3\x99\xc3\x9a\xc3\x9b\xc3\x9c\xc3\x9d\xc3\x9e\xc3\x9f\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4\xc3\xa5\xc3\xa6\xc3\xa7\xc3\xa8\xc3\xa9\xc3\xaa\xc3\xab\xc3\xac\xc3\xad\xc3\xae\xc3\xaf\xc3\xb0\xc3\xb1\xc3\xb2\xc3\xb3\xc3\xb4\xc3\xb5\xc3\xb6\xc3\xb7\xc3\xb8\xc3\xb9\xc3\xba\xc3\xbb\xc3\xbc\xc3\xbd\xc3\xbe\xc3\xbf" (test@example.org) files: h (esc)
   |
-  $ HGENCODING=utf-8 glog -R darcs-repo-hg -r 0:5 | "$TESTDIR"/printrepr.py
-  o  5 "p4: desc \xc3\xb1" (author \xc3\xb1) files: g
+  $ HGENCODING=utf-8 glog -R darcs-repo-hg -r 0:5
+  o  5 "p4: desc \xc3\xb1" (author \xc3\xb1) files: g (esc)
   |
   o  4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
   |
--- a/tests/test-convert-svn-encoding.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-convert-svn-encoding.t	Mon Nov 08 01:41:42 2010 +0100
@@ -128,8 +128,8 @@
 
 Check tags are in UTF-8
 
-  $ python -c "print '\n'.join([('%r' % l) for l in file('.hgtags', 'rb').readlines()])"
-  '221c3fdaf24df5f14c0a64c597581e2eacfb47bb branch\xc3\xa9e\n'
-  '7a40952c2db29cf00d9e31df3749e98d8a4bdcbf branch\xc3\xa9\n'
+  $ cat .hgtags
+  221c3fdaf24df5f14c0a64c597581e2eacfb47bb branch\xc3\xa9e (esc)
+  7a40952c2db29cf00d9e31df3749e98d8a4bdcbf branch\xc3\xa9 (esc)
 
   $ cd ..
--- a/tests/test-eol-add.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-eol-add.t	Mon Nov 08 01:41:42 2010 +0100
@@ -48,7 +48,7 @@
   >     echo '% hg status'
   >     hg status
   >     echo '% hg tip -p'
-  >     hg tip -p | python $TESTDIR/printrepr.py
+  >     hg tip -p
   >     cd ..
   >     rm -r repo-$1
   > }
@@ -118,8 +118,8 @@
   -first
   -second
   -third
-  +first\r
-  +second\r
-  +third\r
+  +first\r (esc)
+  +second\r (esc)
+  +third\r (esc)
   
   $ rm -r repo
--- a/tests/test-eol-clone.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-eol-clone.t	Mon Nov 08 01:41:42 2010 +0100
@@ -31,11 +31,11 @@
   updating to branch default
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd repo-2
-  $ python $TESTDIR/printrepr.py < a.txt
-  first\r
-  second\r
-  third\r
-  $ hg cat a.txt | python $TESTDIR/printrepr.py
+  $ cat a.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
+  $ hg cat a.txt
   first
   second
   third
@@ -51,7 +51,7 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd repo-3
 
-  $ python $TESTDIR/printrepr.py < a.txt
+  $ cat a.txt
   first
   second
   third
@@ -71,7 +71,7 @@
   [patterns]
   **.txt = native
 
-  $ python $TESTDIR/printrepr.py < a.txt
-  first\r
-  second\r
-  third\r
+  $ cat a.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
--- a/tests/test-eol-patch.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-eol-patch.t	Mon Nov 08 01:41:42 2010 +0100
@@ -50,30 +50,30 @@
   > native = $1
   > EOF
   >     hg update
-  >     echo '% printrepr.py native.txt'
-  >     python $TESTDIR/printrepr.py < native.txt
-  >     echo '% printrepr.py unix.txt'
-  >     python $TESTDIR/printrepr.py < unix.txt
-  >     echo '% printrepr.py win.txt'
-  >     python $TESTDIR/printrepr.py < win.txt
+  >     echo '% native.txt'
+  >     cat native.txt
+  >     echo '% unix.txt'
+  >     cat unix.txt
+  >     echo '% win.txt'
+  >     cat win.txt
   >     printf "first${EOL}third${EOL}" > native.txt
   >     printf "first\r\nthird\r\n" > win.txt
   >     printf "first\nthird\n" > unix.txt
   >     echo '% hg diff'
   >     hg diff > p
-  >     python $TESTDIR/printrepr.py < p
+  >     cat p
   >     echo '% hg revert'
   >     hg revert --all
   >     echo '% hg import'
   >     hg import -m 'patch' p
-  >     echo '% printrepr.py native.txt'
-  >     python $TESTDIR/printrepr.py < native.txt
-  >     echo '% printrepr.py unix.txt'
-  >     python $TESTDIR/printrepr.py < unix.txt
-  >     echo '% printrepr.py win.txt'
-  >     python $TESTDIR/printrepr.py < win.txt
+  >     echo '% native.txt'
+  >     cat native.txt
+  >     echo '% unix.txt'
+  >     cat unix.txt
+  >     echo '% win.txt'
+  >     cat win.txt
   >     echo '% hg diff -c tip'
-  >     hg diff -c tip | python $TESTDIR/printrepr.py
+  >     hg diff -c tip
   >     cd ..
   >     rm -r repo-$1
   > }
@@ -92,18 +92,18 @@
   
   % hg clone repo repo-LF
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py native.txt
+  % native.txt
   first
   second
   third
-  % printrepr.py unix.txt
+  % unix.txt
   first
   second
   third
-  % printrepr.py win.txt
-  first\r
-  second\r
-  third\r
+  % win.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
   % hg diff
   diff --git a/native.txt b/native.txt
   --- a/native.txt
@@ -123,24 +123,24 @@
   --- a/win.txt
   +++ b/win.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   % hg revert
   reverting native.txt
   reverting unix.txt
   reverting win.txt
   % hg import
   applying p
-  % printrepr.py native.txt
+  % native.txt
   first
   third
-  % printrepr.py unix.txt
+  % unix.txt
   first
   third
-  % printrepr.py win.txt
-  first\r
-  third\r
+  % win.txt
+  first\r (esc)
+  third\r (esc)
   % hg diff -c tip
   diff --git a/native.txt b/native.txt
   --- a/native.txt
@@ -160,25 +160,25 @@
   --- a/win.txt
   +++ b/win.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   $ dotest CRLF
   
   % hg clone repo repo-CRLF
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py native.txt
-  first\r
-  second\r
-  third\r
-  % printrepr.py unix.txt
+  % native.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
+  % unix.txt
   first
   second
   third
-  % printrepr.py win.txt
-  first\r
-  second\r
-  third\r
+  % win.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
   % hg diff
   diff --git a/native.txt b/native.txt
   --- a/native.txt
@@ -198,24 +198,24 @@
   --- a/win.txt
   +++ b/win.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   % hg revert
   reverting native.txt
   reverting unix.txt
   reverting win.txt
   % hg import
   applying p
-  % printrepr.py native.txt
-  first\r
-  third\r
-  % printrepr.py unix.txt
+  % native.txt
+  first\r (esc)
+  third\r (esc)
+  % unix.txt
   first
   third
-  % printrepr.py win.txt
-  first\r
-  third\r
+  % win.txt
+  first\r (esc)
+  third\r (esc)
   % hg diff -c tip
   diff --git a/native.txt b/native.txt
   --- a/native.txt
@@ -235,9 +235,9 @@
   --- a/win.txt
   +++ b/win.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   $ rm -r repo
   $ makerepo CRLF
   
@@ -251,26 +251,26 @@
   
   % hg clone repo repo-LF
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py native.txt
+  % native.txt
   first
   second
   third
-  % printrepr.py unix.txt
+  % unix.txt
   first
   second
   third
-  % printrepr.py win.txt
-  first\r
-  second\r
-  third\r
+  % win.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
   % hg diff
   diff --git a/native.txt b/native.txt
   --- a/native.txt
   +++ b/native.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   diff --git a/unix.txt b/unix.txt
   --- a/unix.txt
   +++ b/unix.txt
@@ -282,32 +282,32 @@
   --- a/win.txt
   +++ b/win.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   % hg revert
   reverting native.txt
   reverting unix.txt
   reverting win.txt
   % hg import
   applying p
-  % printrepr.py native.txt
+  % native.txt
   first
   third
-  % printrepr.py unix.txt
+  % unix.txt
   first
   third
-  % printrepr.py win.txt
-  first\r
-  third\r
+  % win.txt
+  first\r (esc)
+  third\r (esc)
   % hg diff -c tip
   diff --git a/native.txt b/native.txt
   --- a/native.txt
   +++ b/native.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   diff --git a/unix.txt b/unix.txt
   --- a/unix.txt
   +++ b/unix.txt
@@ -319,33 +319,33 @@
   --- a/win.txt
   +++ b/win.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   $ dotest CRLF
   
   % hg clone repo repo-CRLF
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py native.txt
-  first\r
-  second\r
-  third\r
-  % printrepr.py unix.txt
+  % native.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
+  % unix.txt
   first
   second
   third
-  % printrepr.py win.txt
-  first\r
-  second\r
-  third\r
+  % win.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
   % hg diff
   diff --git a/native.txt b/native.txt
   --- a/native.txt
   +++ b/native.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   diff --git a/unix.txt b/unix.txt
   --- a/unix.txt
   +++ b/unix.txt
@@ -357,32 +357,32 @@
   --- a/win.txt
   +++ b/win.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   % hg revert
   reverting native.txt
   reverting unix.txt
   reverting win.txt
   % hg import
   applying p
-  % printrepr.py native.txt
-  first\r
-  third\r
-  % printrepr.py unix.txt
+  % native.txt
+  first\r (esc)
+  third\r (esc)
+  % unix.txt
   first
   third
-  % printrepr.py win.txt
-  first\r
-  third\r
+  % win.txt
+  first\r (esc)
+  third\r (esc)
   % hg diff -c tip
   diff --git a/native.txt b/native.txt
   --- a/native.txt
   +++ b/native.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   diff --git a/unix.txt b/unix.txt
   --- a/unix.txt
   +++ b/unix.txt
@@ -394,7 +394,7 @@
   --- a/win.txt
   +++ b/win.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   $ rm -r repo
--- a/tests/test-eol-update.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-eol-update.t	Mon Nov 08 01:41:42 2010 +0100
@@ -54,23 +54,23 @@
   > 
   >     hg update
   > 
-  >     echo '% printrepr.py a.txt (before)'
-  >     python $TESTDIR/printrepr.py < a.txt
+  >     echo '% a.txt (before)'
+  >     cat a.txt
   > 
   >     printf "first${EOL}third${EOL}" > a.txt
   > 
-  >     echo '% printrepr.py a.txt (after)'
-  >     python $TESTDIR/printrepr.py < a.txt
+  >     echo '% a.txt (after)'
+  >     cat a.txt
   >     echo '% hg diff'
-  >     hg diff | python $TESTDIR/printrepr.py
+  >     hg diff
   > 
   >     echo '% hg update 0'
   >     hg update 0
   > 
-  >     echo '% printrepr.py a.txt'
-  >     python $TESTDIR/printrepr.py < a.txt
+  >     echo '% a.txt'
+  >     cat a.txt
   >     echo '% hg diff'
-  >     hg diff | python $TESTDIR/printrepr.py
+  >     hg diff
   > 
   > 
   >     cd ..
@@ -87,11 +87,11 @@
   
   % hg clone repo repo-LF
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py a.txt (before)
-  first\r
-  second\r
-  third\r
-  % printrepr.py a.txt (after)
+  % a.txt (before)
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
+  % a.txt (after)
   first
   third
   % hg diff
@@ -99,13 +99,13 @@
   --- a/a.txt
   +++ b/a.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   % hg update 0
   merging a.txt
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py a.txt
+  % a.txt
   first
   third
   % hg diff
@@ -120,25 +120,25 @@
   
   % hg clone repo repo-CRLF
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py a.txt (before)
-  first\r
-  second\r
-  third\r
-  % printrepr.py a.txt (after)
-  first\r
-  third\r
+  % a.txt (before)
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
+  % a.txt (after)
+  first\r (esc)
+  third\r (esc)
   % hg diff
   diff --git a/a.txt b/a.txt
   --- a/a.txt
   +++ b/a.txt
   @@ -1,3 +1,2 @@
-   first\r
-  -second\r
-   third\r
+   first\r (esc)
+  -second\r (esc)
+   third\r (esc)
   % hg update 0
   merging a.txt
   1 files updated, 1 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py a.txt
+  % a.txt
   first
   third
   % hg diff
--- a/tests/test-eol.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-eol.t	Mon Nov 08 01:41:42 2010 +0100
@@ -61,20 +61,20 @@
   > native = $1
   > EOF
   >     hg update
-  >     echo '% printrepr.py a.txt'
-  >     python $TESTDIR/printrepr.py < a.txt
+  >     echo '% a.txt'
+  >     cat a.txt
   >     echo '% hg cat a.txt'
-  >     hg cat a.txt | python $TESTDIR/printrepr.py
+  >     hg cat a.txt
   >     printf "fourth${EOL}" >> a.txt
-  >     echo '% printrepr.py a.txt'
-  >     python $TESTDIR/printrepr.py < a.txt
-  >     hg diff | python $TESTDIR/printrepr.py
+  >     echo '% a.txt'
+  >     cat a.txt
+  >     hg diff
   >     python ../switch-eol.py $1 a.txt
   >     echo '% hg diff only reports a single changed line:'
-  >     hg diff | python $TESTDIR/printrepr.py
+  >     hg diff
   >     echo "% reverting back to $1 format"
   >     hg revert a.txt
-  >     python $TESTDIR/printrepr.py < a.txt
+  >     cat a.txt
   >     printf "first\r\nsecond\n" > mixed.txt
   >     hg add mixed.txt
   >     echo "% hg commit of inconsistent .txt file marked as binary (should work)"
@@ -144,7 +144,7 @@
   $ dotest LF
   % hg clone repo repo-LF
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py a.txt
+  % a.txt
   first
   second
   third
@@ -152,7 +152,7 @@
   first
   second
   third
-  % printrepr.py a.txt
+  % a.txt
   first
   second
   third
@@ -188,19 +188,19 @@
   $ dotest CRLF
   % hg clone repo repo-CRLF
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py a.txt
-  first\r
-  second\r
-  third\r
+  % a.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
   % hg cat a.txt
   first
   second
   third
-  % printrepr.py a.txt
-  first\r
-  second\r
-  third\r
-  fourth\r
+  % a.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
+  fourth\r (esc)
   diff --git a/a.txt b/a.txt
   --- a/a.txt
   +++ b/a.txt
@@ -220,9 +220,9 @@
    third
   +fourth
   % reverting back to CRLF format
-  first\r
-  second\r
-  third\r
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
   % hg commit of inconsistent .txt file marked as binary (should work)
   % hg commit of inconsistent .txt file marked as native (should fail)
   abort: inconsistent newline style in a.txt
@@ -238,15 +238,15 @@
   $ dotest LF
   % hg clone repo repo-LF
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py a.txt
+  % a.txt
   first
   second
   third
   % hg cat a.txt
-  first\r
-  second\r
-  third\r
-  % printrepr.py a.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
+  % a.txt
   first
   second
   third
@@ -255,20 +255,20 @@
   --- a/a.txt
   +++ b/a.txt
   @@ -1,3 +1,4 @@
-   first\r
-   second\r
-   third\r
-  +fourth\r
+   first\r (esc)
+   second\r (esc)
+   third\r (esc)
+  +fourth\r (esc)
   % switching encoding from '\n' to '\r\n'
   % hg diff only reports a single changed line:
   diff --git a/a.txt b/a.txt
   --- a/a.txt
   +++ b/a.txt
   @@ -1,3 +1,4 @@
-   first\r
-   second\r
-   third\r
-  +fourth\r
+   first\r (esc)
+   second\r (esc)
+   third\r (esc)
+  +fourth\r (esc)
   % reverting back to LF format
   first
   second
@@ -282,41 +282,41 @@
   $ dotest CRLF
   % hg clone repo repo-CRLF
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  % printrepr.py a.txt
-  first\r
-  second\r
-  third\r
+  % a.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
   % hg cat a.txt
-  first\r
-  second\r
-  third\r
-  % printrepr.py a.txt
-  first\r
-  second\r
-  third\r
-  fourth\r
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
+  % a.txt
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
+  fourth\r (esc)
   diff --git a/a.txt b/a.txt
   --- a/a.txt
   +++ b/a.txt
   @@ -1,3 +1,4 @@
-   first\r
-   second\r
-   third\r
-  +fourth\r
+   first\r (esc)
+   second\r (esc)
+   third\r (esc)
+  +fourth\r (esc)
   % switching encoding from '\r\n' to '\n'
   % hg diff only reports a single changed line:
   diff --git a/a.txt b/a.txt
   --- a/a.txt
   +++ b/a.txt
   @@ -1,3 +1,4 @@
-   first\r
-   second\r
-   third\r
-  +fourth\r
+   first\r (esc)
+   second\r (esc)
+   third\r (esc)
+  +fourth\r (esc)
   % reverting back to CRLF format
-  first\r
-  second\r
-  third\r
+  first\r (esc)
+  second\r (esc)
+  third\r (esc)
   % hg commit of inconsistent .txt file marked as binary (should work)
   % hg commit of inconsistent .txt file marked as native (should fail)
   abort: inconsistent newline style in a.txt
--- a/tests/test-git-import.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-git-import.t	Mon Nov 08 01:41:42 2010 +0100
@@ -352,10 +352,10 @@
   > EOF
   applying patch from stdin
 
-  $ python $TESTDIR/printrepr.py < binary2
+  $ cat binary2
   a
   b
-  \x00
+  \x00 (no-eol) (esc)
 
   $ hg st --copies --change . 
   A binary2
--- a/tests/test-hgweb-commands.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-hgweb-commands.t	Mon Nov 08 01:41:42 2010 +0100
@@ -919,15 +919,13 @@
 
 changegroup
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000' \
-  >     | $TESTDIR/printrepr.py
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000'
   200 Script output follows
   
-  x\x9c\xbdTMHUA\x14\xbe\x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-  \xb0\x90\x92\x88\xb9\x14"\x068\xc2\x1e@\x00\xbb\x8a)\xd3\'\x859
-  \xa8\x80\x84S \xa5\xbd-g\x13`\xe4\xdc\xc3H^\xdf\xe2\xc0TM\xc7\xf4BO\xcf\xde\xae\xe5\xae#\x1frM(K\x97`F\x19\x16s\x05GD\xb9\x01\xc1\x00+\x8c|\x9fp\xc11\xf0\x14\x00\x9cJ\x82<\xe0\x12\x9f\xc1\x90\xd0\xf5\xc8\x19>Pr\xaa\xeaW\xf5\xc4\xae\xd1\xfc\x17\xcf\'\x13u\xb1\x9e\xcdHnC\x0e\xcc`\xc8\xa0&\xac\x0e\xf1|\x8c\x10$\xc4\x8c\xa2p\x05`\xdc\x08 \x80\xc4\xd7Rr-\x94\x10\x102\xedi;\xf3f\xf1z\x16\x86\xdb\xd8d\xe5\xe7\x8b\xf5\x8d\rzp\xb2\xfe\xac\xf5\xf2\xd3\xfe\xfckws\xedt\x96b\xd5l\x1c\x0b\x85\xb5\x170\x8f\x11\x84\xb0\x8f\x19\xa0\x00\t_\x07\x1ac\xa2\xc3\x89Z\xe7\x96\xf9 \xccNFg\xc7F\xaa\x8a+\x9a\x9cc_\x17\x1b\x17\x9e]z38<\x97+\xb5,",\xc8\xc8?\\\x91\xff\x17.~U\x96\x97\xf5%\xdeN<\x8e\xf5\x97%\xe7^\xcfL\xed~\xda\x96k\xdc->\x86\x02\x83"\x96H\xa6\xe3\xaas=-\xeb7\xe5\xda\x8f\xbc
+  x\x9c\xbdTMHUA\x14\xbe\xa8\xf9\xec\xda&\x10\x11*\xb8\x88\x81\x99\xbef\xe6\xce\xbdw\xc6\xf2a\x16E\x1b\x11[%\x98\xcc\xaf\x8f\x8c\xf7\xc0\xf7\x82 (esc)
+  4\x11KP2m\x95\xad*\xabE\x05AP\xd0\xc22Z\x14\xf9\x03\xb9j\xa3\x9b$\xa4MJ\xb4\x90\xc0\x9a\x9bO0\x10\xdf\x13\xa2\x81\x0f\x869g\xe6|\xe7\x9c\xef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x90\xd0\xf5\xc8\x19>Pr\xaa\xeaW\xf5\xc4\xae\xd1\xfc\x17\xcf'\x13u\xb1\x9e\xcdHnC\x0e\xcc`\xc8\xa0&\xac\x0e\xf1|\x8c\x10$\xc4\x8c\xa2p\x05`\xdc\x08 \x80\xc4\xd7Rr-\x94\x10\x102\xedi;\xf3f\xf1z\x16\x86\xdb\xd8d\xe5\xe7\x8b\xf5\x8d\rzp\xb2\xfe\xac\xf5\xf2\xd3\xfe\xfckws\xedt\x96b\xd5l\x1c\x0b\x85\xb5\x170\x8f\x11\x84\xb0\x8f\x19\xa0\x00	_\x07\x1ac\xa2\xc3\x89Z\xe7\x96\xf9 \xccNFg\xc7F\xaa\x8a+\x9a\x9cc_\x17\x1b\x17\x9e]z38<\x97+\xb5,",\xc8\xc8?\\\x91\xff\x17.~U\x96\x97\xf5%\xdeN<\x8e\xf5\x97%\xe7^\xcfL\xed~\xda\x96k\xdc->\x86\x02\x83"\x96H\xa6\xe3\xaas=-\xeb7\xe5\xda\x8f\xbc (no-eol) (esc)
 
 stream_out
 
--- a/tests/test-highlight.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-highlight.t	Mon Nov 08 01:41:42 2010 +0100
@@ -583,19 +583,19 @@
   > 
   >     echo % hgweb filerevision, html
   >     "$TESTDIR/get-with-headers.py" localhost:$HGPORT "/file/tip/$2" \
-  >         | grep '<div class="parity0 source">' | $TESTDIR/printrepr.py
+  >         | grep '<div class="parity0 source">'
   >     echo % errors encountered
   >     cat errors.log
   > }
   $ hgserveget euc-jp eucjp.txt
   % HGENCODING=euc-jp hg serve
   % hgweb filerevision, html
-  <div class="parity0 source"><a href="#l1" id="l1">     1</a> \xb5\xfe</div>
+  <div class="parity0 source"><a href="#l1" id="l1">     1</a> \xb5\xfe</div> (esc)
   % errors encountered
   $ hgserveget utf-8 eucjp.txt
   % HGENCODING=utf-8 hg serve
   % hgweb filerevision, html
-  <div class="parity0 source"><a href="#l1" id="l1">     1</a> \xef\xbf\xbd\xef\xbf\xbd</div>
+  <div class="parity0 source"><a href="#l1" id="l1">     1</a> \xef\xbf\xbd\xef\xbf\xbd</div> (esc)
   % errors encountered
   $ hgserveget us-ascii eucjp.txt
   % HGENCODING=us-ascii hg serve
--- a/tests/test-import-eol.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-import-eol.t	Mon Nov 08 01:41:42 2010 +0100
@@ -45,8 +45,13 @@
 
   $ hg --traceback --config patch.eol='LF' import eol.diff
   applying eol.diff
-  $ python -c 'print repr(file("a","rb").read())'
-  'a\nyyyy\ncc\n\nd\ne'
+  $ cat a
+  a
+  yyyy
+  cc
+  
+  d
+  e (no-eol)
   $ hg st
 
 
@@ -56,8 +61,13 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg --traceback --config patch.eol='CRLF' import eol.diff
   applying eol.diff
-  $ python -c 'print repr(file("a","rb").read())'
-  'a\r\nyyyy\r\ncc\r\n\r\nd\r\ne'
+  $ cat a
+  a\r (esc)
+  yyyy\r (esc)
+  cc\r (esc)
+  \r (esc)
+  d\r (esc)
+  e (no-eol)
   $ hg st
 
 
@@ -67,8 +77,13 @@
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg --traceback --config patch.eol='auto' import eol.diff
   applying eol.diff
-  $ python -c 'print repr(file("a","rb").read())'
-  'a\nyyyy\ncc\n\nd\ne'
+  $ cat a
+  a
+  yyyy
+  cc
+  
+  d
+  e (no-eol)
   $ hg st
 
 
@@ -78,8 +93,13 @@
   $ hg commit -m 'switch EOLs in a'
   $ hg --traceback --config patch.eol='auto' import eol.diff
   applying eol.diff
-  $ python -c 'print repr(file("a","rb").read())'
-  'a\r\nyyyy\r\ncc\r\n\r\nd\r\ne'
+  $ cat a
+  a\r (esc)
+  yyyy\r (esc)
+  cc\r (esc)
+  \r (esc)
+  d\r (esc)
+  e (no-eol)
   $ hg st
 
 
@@ -96,10 +116,12 @@
   $ rm neweol
   $ hg --traceback --config patch.eol='auto' import -m noeol noeol.diff
   applying noeol.diff
-  $ python -c 'print repr(file("noeol","rb").read())'
-  'noeol\r\nnoeol\n'
-  $ python -c 'print repr(file("neweol","rb").read())'
-  'neweol\nneweol\r\n'
+  $ cat noeol
+  noeol\r (esc)
+  noeol
+  $ cat neweol
+  neweol
+  neweol\r (esc)
   $ hg st
 
 
@@ -116,7 +138,9 @@
 
   $ hg import --config patch.eol='CRLF' -m changeb bin.diff
   applying bin.diff
-  $ python -c 'print repr(file("b","rb").read())'
-  'a\x00\nc\r\nd'
+  $ cat b
+  a\x00 (esc)
+  c\r (esc)
+  d (no-eol)
   $ hg st
   $ cd ..
--- a/tests/test-simplemerge-cmd.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-simplemerge-cmd.t	Mon Nov 08 01:41:42 2010 +0100
@@ -104,9 +104,9 @@
 
 binary file --text
 
-  $ python simplemerge -a -p binary-local base other 2>&1 | $TESTDIR/printrepr.py
+  $ python simplemerge -a -p binary-local base other 2>&1
   warning: binary-local looks like a binary file.
-  \x00local
+  \x00local (esc)
   base
   other
 
--- a/tests/test-transplant.t	Mon Nov 08 01:41:41 2010 +0100
+++ b/tests/test-transplant.t	Mon Nov 08 01:41:42 2010 +0100
@@ -357,6 +357,7 @@
   $ hg transplant -s ../twin1 tip
   applying 2e849d776c17
   2e849d776c17 transplanted to 589cea8ba85b
-  $ python -c "print repr(file('b', 'rb').read())"
-  'a\r\nb\r\n'
+  $ cat b
+  a\r (esc)
+  b\r (esc)
   $ cd ..