merge with crew
authorMatt Mackall <mpm@selenic.com>
Sun, 07 Nov 2010 19:42:42 -0600
changeset 12946 24a1d7ad12a4
parent 12939 0cb90f9c6d8e (current diff)
parent 12945 99f7dc8def34 (diff)
child 12954 85777aab7e08
merge with crew
tests/printrepr.py
--- a/tests/printrepr.py	Sun Nov 07 16:01:57 2010 -0600
+++ /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/run-tests.py	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/run-tests.py	Sun Nov 07 19:42:42 2010 -0600
@@ -454,6 +454,15 @@
     vlog("# Running", cmd)
     return run(cmd, options, replacements)
 
+needescape = re.compile(r'[\x00-\x08\x0b-\x1f\x7f-\xff]').search
+escapesub = re.compile(r'[\x00-\x08\x0b-\x1f\\\x7f-\xff]').sub
+escapemap = dict((chr(i), r'\x%02x' % i) for i in range(256))
+escapemap.update({'\\': '\\\\', '\r': r'\r'})
+def escapef(m):
+    return escapemap[m.group(0)]
+def stringescape(s):
+    return escapesub(escapef, s)
+
 def tsttest(test, options, replacements):
     t = open(test)
     out = []
@@ -464,6 +473,8 @@
     after = {}
     expected = {}
     for n, l in enumerate(t):
+        if not l.endswith('\n'):
+            l += '\n'
         if l.startswith('  $ '): # commands
             after.setdefault(pos, []).append(l)
             prepos = pos
@@ -480,8 +491,6 @@
             # non-command/result - queue up for merged output
             after.setdefault(pos, []).append(l)
 
-    if script and not script[-1].endswith('\n'):
-        script[-1] = script[-1] + '\n'
     script.append('echo %s %s $?\n' % (salt, n + 1))
 
     fd, name = tempfile.mkstemp(suffix='hg-tst')
@@ -531,29 +540,38 @@
     postout = []
     ret = 0
     for n, l in enumerate(output):
-        if l.startswith(salt):
+        lout, lcmd = l, None
+        if salt in l:
+            lout, lcmd = l.split(salt, 1)
+
+        if lout:
+            if lcmd:
+                lout += ' (no-eol)\n'
+
+            el = None
+            if pos in expected and expected[pos]:
+                el = expected[pos].pop(0)
+
+            if el == lout: # perfect match (fast)
+                postout.append("  " + lout)
+            elif (el and
+                  (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', lout) or
+                   el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', lout)) or
+                   el.endswith(" (esc)\n") and el.decode('string-escape') == l):
+                postout.append("  " + el) # fallback regex/glob/esc match
+            else:
+                if needescape(lout):
+                    lout = stringescape(lout.rstrip('\n')) + " (esc)\n"
+                postout.append("  " + lout) # let diff deal with it
+
+        if lcmd:
             # add on last return code
-            ret = int(l.split()[2])
+            ret = int(lcmd.split()[1])
             if ret != 0:
                 postout.append("  [%s]\n" % ret)
             if pos in after:
                 postout += after.pop(pos)
-            pos = int(l.split()[1])
-        else:
-            el = None
-            if pos in expected and expected[pos]:
-                el = expected[pos].pop(0)
-
-            if el == l: # perfect match (fast)
-                postout.append("  " + l)
-            elif el and el.decode('string-escape') == l:
-                postout.append("  " + el)  # \-escape match
-            elif (el and
-                  (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', l) or
-                   el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', l))):
-                postout.append("  " + el) # fallback regex/glob match
-            else:
-                postout.append("  " + l) # let diff deal with it
+            pos = int(lcmd.split()[0])
 
     if pos in after:
         postout += after.pop(pos)
--- a/tests/test-bookmarks-current.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-bookmarks-current.t	Sun Nov 07 19:42:42 2010 -0600
@@ -24,7 +24,7 @@
 
   $ hg --config extensions.color= --config color.mode=ansi \
   >     bookmark --color=always
-   * X                         -1:000000000000
+  \x1b[0;32m * X                         -1:000000000000\x1b[0m (esc)
 
 update to bookmark X
 
--- a/tests/test-bookmarks.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-bookmarks.t	Sun Nov 07 19:42:42 2010 -0600
@@ -21,7 +21,7 @@
 
   $ hg --config extensions.color= --config color.mode=ansi \
   >    bookmarks --color=always
-   * X                         -1:000000000000
+  \x1b[0;32m * X                         -1:000000000000\x1b[0m (esc)
 
   $ echo a > a
   $ hg add a
--- a/tests/test-branch-option.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-branch-option.t	Sun Nov 07 19:42:42 2010 -0600
@@ -34,13 +34,13 @@
   $ hg up 0
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg --encoding utf-8 branch æ
-  marked working directory as branch æ
+  marked working directory as branch \xc3\xa6 (esc)
   $ echo ae1 > foo
   $ hg ci -d '0 0' -mae1
   $ hg up 0
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg --encoding utf-8 branch -f æ
-  marked working directory as branch æ
+  marked working directory as branch \xc3\xa6 (esc)
   $ echo ae2 > foo
   $ hg ci -d '0 0' -mae2
   created new head
--- a/tests/test-branches.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-branches.t	Sun Nov 07 19:42:42 2010 -0600
@@ -357,19 +357,19 @@
   $ hg up -C b
   2 files updated, 0 files merged, 3 files removed, 0 files unresolved
   $ hg branches --color=always
-  b                             13:6ac12926b8c3
-  a branch name much longer than the default justification used by branches 7:10ff5895aa57
-  a                              5:d8cbc61dbaa6 (inactive)
-  default                        0:19709c5a4e75 (inactive)
+  \x1b[0;32mb\x1b[0m \x1b[0;33m                            13:6ac12926b8c3\x1b[0m (esc)
+  \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m \x1b[0;33m7:10ff5895aa57\x1b[0m (esc)
+  \x1b[0;0ma\x1b[0m \x1b[0;33m                             5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
+  \x1b[0;0mdefault\x1b[0m \x1b[0;33m                       0:19709c5a4e75\x1b[0m (inactive) (esc)
 
 default closed branch color:
 
   $ hg branches --color=always --closed
-  b                             13:6ac12926b8c3
-  a branch name much longer than the default justification used by branches 7:10ff5895aa57
-  c                             14:717d2e6fabe1 (closed)
-  a                              5:d8cbc61dbaa6 (inactive)
-  default                        0:19709c5a4e75 (inactive)
+  \x1b[0;32mb\x1b[0m \x1b[0;33m                            13:6ac12926b8c3\x1b[0m (esc)
+  \x1b[0;0ma branch name much longer than the default justification used by branches\x1b[0m \x1b[0;33m7:10ff5895aa57\x1b[0m (esc)
+  \x1b[0;30;1mc\x1b[0m \x1b[0;33m                            14:717d2e6fabe1\x1b[0m (closed) (esc)
+  \x1b[0;0ma\x1b[0m \x1b[0;33m                             5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
+  \x1b[0;0mdefault\x1b[0m \x1b[0;33m                       0:19709c5a4e75\x1b[0m (inactive) (esc)
 
   $ echo "[extensions]" >> $HGRCPATH
   $ echo "color =" >> $HGRCPATH
@@ -383,16 +383,16 @@
 custom branch colors:
 
   $ hg branches --color=always
-  b                             13:6ac12926b8c3
-  a branch name much longer than the default justification used by branches 7:10ff5895aa57
-  a                              5:d8cbc61dbaa6 (inactive)
-  default                        0:19709c5a4e75 (inactive)
+  \x1b[0;31mb\x1b[0m \x1b[0;36m                            13:6ac12926b8c3\x1b[0m (esc)
+  \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m \x1b[0;36m7:10ff5895aa57\x1b[0m (esc)
+  \x1b[0;35ma\x1b[0m \x1b[0;36m                             5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
+  \x1b[0;35mdefault\x1b[0m \x1b[0;36m                       0:19709c5a4e75\x1b[0m (inactive) (esc)
 
 custom closed branch color:
 
   $ hg branches --color=always --closed
-  b                             13:6ac12926b8c3
-  a branch name much longer than the default justification used by branches 7:10ff5895aa57
-  c                             14:717d2e6fabe1 (closed)
-  a                              5:d8cbc61dbaa6 (inactive)
-  default                        0:19709c5a4e75 (inactive)
+  \x1b[0;31mb\x1b[0m \x1b[0;36m                            13:6ac12926b8c3\x1b[0m (esc)
+  \x1b[0;32ma branch name much longer than the default justification used by branches\x1b[0m \x1b[0;36m7:10ff5895aa57\x1b[0m (esc)
+  \x1b[0;34mc\x1b[0m \x1b[0;36m                            14:717d2e6fabe1\x1b[0m (closed) (esc)
+  \x1b[0;35ma\x1b[0m \x1b[0;36m                             5:d8cbc61dbaa6\x1b[0m (inactive) (esc)
+  \x1b[0;35mdefault\x1b[0m \x1b[0;36m                       0:19709c5a4e75\x1b[0m (inactive) (esc)
--- a/tests/test-churn.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-churn.t	Sun Nov 07 19:42:42 2010 -0600
@@ -102,9 +102,9 @@
 
   $ hg --config extensions.color= churn --config color.mode=ansi \
   >     --diffstat --color=always
-  user1           +3/-1 +++++++++++++++++++++++++++++++++++++++++--------------
-  user3           +3/-0 +++++++++++++++++++++++++++++++++++++++++
-  user2           +2/-0 +++++++++++++++++++++++++++
+  user1           +3/-1 \x1b[0;32m+++++++++++++++++++++++++++++++++++++++++\x1b[0m\x1b[0;31m--------------\x1b[0m (esc)
+  user3           +3/-0 \x1b[0;32m+++++++++++++++++++++++++++++++++++++++++\x1b[0m (esc)
+  user2           +2/-0 \x1b[0;32m+++++++++++++++++++++++++++\x1b[0m (esc)
 
 
 changeset number churn
--- a/tests/test-convert-darcs.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-convert-darcs.t	Sun Nov 07 19:42:42 2010 -0600
@@ -82,7 +82,7 @@
 darcs is encoding agnostic, so it takes whatever bytes it's given
 
   $ darcs record -a -l -m 'p4: desc ñ' -A 'author ñ'
-  Finished recording patch 'p4: desc ñ'
+  Finished recording patch 'p4: desc \xc3\xb1' (esc)
 
 Test latin-1 commit message
 
@@ -90,7 +90,7 @@
   $ printf "p5: desc " > ../p5
   $ python -c 'print "".join([chr(i) for i in range(128, 256)])' >> ../p5
   $ darcs record -a -l --logfile ../p5
-  Finished recording patch 'p5: desc '
+  Finished recording patch 'p5: desc \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff' (esc)
  
   $ glog()
   > {
@@ -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\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
+  $ HGENCODING=latin-1 glog -R darcs-repo-hg -r 6
+  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\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	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-convert-svn-encoding.t	Sun Nov 07 19:42:42 2010 -0600
@@ -20,8 +20,8 @@
   found trunk at 'trunk'
   found tags at 'tags'
   found branches at 'branches'
-  found branch branché at 5
-  found branch branchée at 6
+  found branch branch\xc3\xa9 at 5 (esc)
+  found branch branch\xc3\xa9e at 6 (esc)
   scanning: 1 revisions
   reparent to file://*/svn-repo/trunk (glob)
   fetching revision log for "/trunk" from 4 to 0
@@ -34,18 +34,18 @@
   '/tags' is not under '/trunk', ignoring
   scanning: 2 revisions
   reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
-  fetching revision log for "/branches/branché" from 5 to 0
+  fetching revision log for "/branches/branch\xc3\xa9" from 5 to 0 (esc)
   parsing revision 5 (1 changes)
   reparent to file://*/svn-repo (glob)
   reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
-  found parent of branch /branches/branché at 4: /trunk
+  found parent of branch /branches/branch\xc3\xa9 at 4: /trunk (esc)
   scanning: 3 revisions
   reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
-  fetching revision log for "/branches/branchée" from 6 to 0
+  fetching revision log for "/branches/branch\xc3\xa9e" from 6 to 0 (esc)
   parsing revision 6 (1 changes)
   reparent to file://*/svn-repo (glob)
   reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
-  found parent of branch /branches/branchée at 5: /branches/branché
+  found parent of branch /branches/branch\xc3\xa9e at 5: /branches/branch\xc3\xa9 (esc)
   scanning: 4 revisions
   scanning: 5 revisions
   scanning: 6 revisions
@@ -58,63 +58,63 @@
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@2
   converting: 1/6 revisions (16.67%)
   reparent to file://*/svn-repo/trunk (glob)
-  scanning paths: /trunk/à 0/3 (0.00%)
-  scanning paths: /trunk/à/é 1/3 (33.33%)
-  scanning paths: /trunk/é 2/3 (66.67%)
-  à/é
-  getting files: à/é 1/2 (50.00%)
-  é
-  getting files: é 2/2 (100.00%)
+  scanning paths: /trunk/\xc3\xa0 0/3 (0.00%) (esc)
+  scanning paths: /trunk/\xc3\xa0/e\xcc\x81 1/3 (33.33%) (esc)
+  scanning paths: /trunk/\xc3\xa9 2/3 (66.67%) (esc)
+  \xc3\xa0/e\xcc\x81 (esc)
+  getting files: \xc3\xa0/e\xcc\x81 1/2 (50.00%) (esc)
+  \xc3\xa9 (esc)
+  getting files: \xc3\xa9 2/2 (100.00%) (esc)
   3 copy files
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@3
   converting: 2/6 revisions (33.33%)
-  scanning paths: /trunk/à 0/4 (0.00%)
+  scanning paths: /trunk/\xc3\xa0 0/4 (0.00%) (esc)
   gone from -1
   reparent to file://*/svn-repo (glob)
   reparent to file://*/svn-repo/trunk (glob)
-  scanning paths: /trunk/è 1/4 (25.00%)
-  copied to è from é@2
-  scanning paths: /trunk/é 2/4 (50.00%)
+  scanning paths: /trunk/\xc3\xa8 1/4 (25.00%) (esc)
+  copied to \xc3\xa8 from \xc3\xa9@2 (esc)
+  scanning paths: /trunk/\xc3\xa9 2/4 (50.00%) (esc)
   gone from -1
   reparent to file://*/svn-repo (glob)
   reparent to file://*/svn-repo/trunk (glob)
-  scanning paths: /trunk/ù 3/4 (75.00%)
-  mark /trunk/ù came from à:2
-  à/é
-  getting files: à/é 1/4 (25.00%)
-  è
-  getting files: è 2/4 (50.00%)
-   è: copy é:6b67ccefd5ce6de77e7ead4f5292843a0255329f
-  é
-  getting files: é 3/4 (75.00%)
-  ù/é
-  getting files: ù/é 4/4 (100.00%)
-   ù/é: copy à/é:a9092a3d84a37b9993b5c73576f6de29b7ea50f6
+  scanning paths: /trunk/\xc3\xb9 3/4 (75.00%) (esc)
+  mark /trunk/\xc3\xb9 came from \xc3\xa0:2 (esc)
+  \xc3\xa0/e\xcc\x81 (esc)
+  getting files: \xc3\xa0/e\xcc\x81 1/4 (25.00%) (esc)
+  \xc3\xa8 (esc)
+  getting files: \xc3\xa8 2/4 (50.00%) (esc)
+   \xc3\xa8: copy \xc3\xa9:6b67ccefd5ce6de77e7ead4f5292843a0255329f (esc)
+  \xc3\xa9 (esc)
+  getting files: \xc3\xa9 3/4 (75.00%) (esc)
+  \xc3\xb9/e\xcc\x81 (esc)
+  getting files: \xc3\xb9/e\xcc\x81 4/4 (100.00%) (esc)
+   \xc3\xb9/e\xcc\x81: copy \xc3\xa0/e\xcc\x81:a9092a3d84a37b9993b5c73576f6de29b7ea50f6 (esc)
   2 remove files
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/trunk@4
   converting: 3/6 revisions (50.00%)
-  scanning paths: /trunk/è 0/2 (0.00%)
+  scanning paths: /trunk/\xc3\xa8 0/2 (0.00%) (esc)
   gone from -1
   reparent to file://*/svn-repo (glob)
   reparent to file://*/svn-repo/trunk (glob)
-  scanning paths: /trunk/ù 1/2 (50.00%)
+  scanning paths: /trunk/\xc3\xb9 1/2 (50.00%) (esc)
   gone from -1
   reparent to file://*/svn-repo (glob)
   reparent to file://*/svn-repo/trunk (glob)
-  è
-  getting files: è 1/2 (50.00%)
-  ù/é
-  getting files: ù/é 2/2 (100.00%)
+  \xc3\xa8 (esc)
+  getting files: \xc3\xa8 1/2 (50.00%) (esc)
+  \xc3\xb9/e\xcc\x81 (esc)
+  getting files: \xc3\xb9/e\xcc\x81 2/2 (100.00%) (esc)
   1 branch to branch?
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?@5
   converting: 4/6 revisions (66.67%)
   reparent to file://*/svn-repo/branches/branch%C3%A9 (glob)
-  scanning paths: /branches/branché 0/1 (0.00%)
+  scanning paths: /branches/branch\xc3\xa9 0/1 (0.00%) (esc)
   0 branch to branch?e
   source: svn:afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af/branches/branch?e@6
   converting: 5/6 revisions (83.33%)
   reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
-  scanning paths: /branches/branchée 0/1 (0.00%)
+  scanning paths: /branches/branch\xc3\xa9e 0/1 (0.00%) (esc)
   reparent to file://*/svn-repo (glob)
   reparent to file://*/svn-repo/branches/branch%C3%A9e (glob)
   reparent to file://*/svn-repo (glob)
@@ -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-diff-color.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-diff-color.t	Sun Nov 07 19:42:42 2010 -0600
@@ -32,15 +32,15 @@
 default context
 
   $ hg diff --nodates --color=always
-  diff -r cf9f4ba66af2 a
-  --- a/a
-  +++ b/a
-  @@ -2,7 +2,7 @@
+  \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
+  \x1b[0;31;1m--- a/a\x1b[0m (esc)
+  \x1b[0;32;1m+++ b/a\x1b[0m (esc)
+  \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
    c
    a
    a
-  -b
-  +dd
+  \x1b[0;31m-b\x1b[0m (esc)
+  \x1b[0;32m+dd\x1b[0m (esc)
    a
    a
    c
@@ -48,21 +48,21 @@
 --unified=2
 
   $ hg diff --nodates -U 2  --color=always
-  diff -r cf9f4ba66af2 a
-  --- a/a
-  +++ b/a
-  @@ -3,5 +3,5 @@
+  \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
+  \x1b[0;31;1m--- a/a\x1b[0m (esc)
+  \x1b[0;32;1m+++ b/a\x1b[0m (esc)
+  \x1b[0;35m@@ -3,5 +3,5 @@\x1b[0m (esc)
    a
    a
-  -b
-  +dd
+  \x1b[0;31m-b\x1b[0m (esc)
+  \x1b[0;32m+dd\x1b[0m (esc)
    a
    a
 
 diffstat
 
   $ hg diff --stat --color=always
-   a |  2 +-
+   a |  2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc)
    1 files changed, 1 insertions(+), 1 deletions(-)
   $ echo "record=" >> $HGRCPATH
   $ echo "[ui]" >> $HGRCPATH
@@ -77,17 +77,17 @@
   > y
   > y
   > EOF
-  diff --git a/a b/a
-  old mode 100644
-  new mode 100755
+  \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
+  \x1b[0;36;1mold mode 100644\x1b[0m (esc)
+  \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
   1 hunks, 1 lines changed
   examine changes to 'a'? [Ynsfdaq?] 
-  @@ -2,7 +2,7 @@
+  \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
    c
    a
    a
-  -b
-  +dd
+  \x1b[0;31m-b\x1b[0m (esc)
+  \x1b[0;32m+dd\x1b[0m (esc)
    a
    a
    c
@@ -105,17 +105,17 @@
   > y
   > y
   > EOF
-  diff --git a/a b/a
-  old mode 100644
-  new mode 100755
+  \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
+  \x1b[0;36;1mold mode 100644\x1b[0m (esc)
+  \x1b[0;36;1mnew mode 100755\x1b[0m (esc)
   1 hunks, 1 lines changed
   examine changes to 'a'? [Ynsfdaq?] 
-  @@ -2,7 +2,7 @@
+  \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
    c
    a
    a
-  -b
-  +dd
+  \x1b[0;31m-b\x1b[0m (esc)
+  \x1b[0;32m+dd\x1b[0m (esc)
    a
    a
    c
--- a/tests/test-diff-ignore-whitespace.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-diff-ignore-whitespace.t	Sun Nov 07 19:42:42 2010 -0600
@@ -402,10 +402,9 @@
   @@ -1,2 +1,3 @@
   -hello world
   -goodbye world
-  +hello world
-  +
-  +goodbye
world
-world
+  +hello world\r (esc)
+  +\r (esc)
+  +goodbye\rworld (esc)
 
 No completely blank lines to ignore:
 
@@ -416,10 +415,9 @@
   @@ -1,2 +1,3 @@
   -hello world
   -goodbye world
-  +hello world
-  +
-  +goodbye
world
-world
+  +hello world\r (esc)
+  +\r (esc)
+  +goodbye\rworld (esc)
 
 Only new line noticed:
 
@@ -429,7 +427,7 @@
   +++ b/foo
   @@ -1,2 +1,3 @@
    hello world
-  +
+  +\r (esc)
    goodbye world
 
   $ hg ndiff --ignore-all-space
@@ -438,7 +436,7 @@
   +++ b/foo
   @@ -1,2 +1,3 @@
    hello world
-  +
+  +\r (esc)
    goodbye world
 
 New line not noticed when space change ignored:
--- a/tests/test-diff-newlines.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-diff-newlines.t	Sun Nov 07 19:42:42 2010 -0600
@@ -13,6 +13,6 @@
   +++ b/a	Thu Jan 01 00:00:02 1970 +0000
   @@ -1,2 +1,3 @@
    confuse str.splitlines
-   embedded
newline
+   embedded\rnewline (esc)
   +clean diff
 
--- a/tests/test-encoding-align.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-encoding-align.t	Sun Nov 07 19:42:42 2010 -0600
@@ -52,9 +52,9 @@
   
   options:
   
-   -s --opt1 \xe7\x9f\xad\xe5\x90\x8d          short width
+   -s --opt1 \xe7\x9f\xad\xe5\x90\x8d          short width (esc)
    -m --opt2 MIDDLE_       middle width
-   -l --opt3 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d  long width
+   -l --opt3 \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d  long width (esc)
   
   use "hg -v help showoptlist" to show global options
 
@@ -96,42 +96,42 @@
 check alignment of user names in annotate
 
   $ hg annotate -u $M
-          \xe7\x9f\xad\xe5\x90\x8d: first line(2)
+          \xe7\x9f\xad\xe5\x90\x8d: first line(2) (esc)
        MIDDLE_: second line(2)
-  \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d: third line(2)
+  \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d: third line(2) (esc)
 
 check alignment of filenames in diffstat
 
   $ hg diff -c tip --stat
    MIDDLE_      |  1 +
-   \xe7\x9f\xad\xe5\x90\x8d         |  1 +
-   \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d |  1 +
+   \xe7\x9f\xad\xe5\x90\x8d         |  1 + (esc)
+   \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d |  1 + (esc)
    3 files changed, 3 insertions(+), 0 deletions(-)
 
 add branches/tags
 
   $ hg branch $S
-  marked working directory as branch \xe7\x9f\xad\xe5\x90\x8d
+  marked working directory as branch \xe7\x9f\xad\xe5\x90\x8d (esc)
   $ hg tag $S
   $ hg branch $M
   marked working directory as branch MIDDLE_
   $ hg tag $M
   $ hg branch $L
-  marked working directory as branch \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d
+  marked working directory as branch \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d (esc)
   $ hg tag $L
 
 check alignment of branches
 
   $ hg tags
   tip                                5:d745ff46155b
-  \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d                       4:9259be597f19
+  \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d                       4:9259be597f19 (esc)
   MIDDLE_                            3:b06c5b6def9e
-  \xe7\x9f\xad\xe5\x90\x8d                               2:64a70663cee8
+  \xe7\x9f\xad\xe5\x90\x8d                               2:64a70663cee8 (esc)
 
 check alignment of tags
 
   $ hg tags
   tip                                5:d745ff46155b
-  \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d                       4:9259be597f19
+  \xe9\x95\xb7\xe3\x81\x84\xe9\x95\xb7\xe3\x81\x84\xe5\x90\x8d\xe5\x89\x8d                       4:9259be597f19 (esc)
   MIDDLE_                            3:b06c5b6def9e
-  \xe7\x9f\xad\xe5\x90\x8d                               2:64a70663cee8
+  \xe7\x9f\xad\xe5\x90\x8d                               2:64a70663cee8 (esc)
--- a/tests/test-encoding.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-encoding.t	Sun Nov 07 19:42:42 2010 -0600
@@ -30,7 +30,7 @@
   $ HGENCODING=ascii hg ci -l latin-1
   transaction abort!
   rollback completed
-  abort: decoding near ' encoded: ': 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)!
+  abort: decoding near ' encoded: \xe9': 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)! (esc)
   [255]
 
 these should work
@@ -41,7 +41,7 @@
   $ HGENCODING=utf-8 hg ci -l utf-8
   $ HGENCODING=latin-1 hg tag `cat latin-1-tag`
   $ HGENCODING=latin-1 hg branch `cat latin-1-tag`
-  marked working directory as branch 
+  marked working directory as branch \xe9 (esc)
   $ HGENCODING=latin-1 hg ci -m 'latin1 branch'
   $ rm .hg/branch
 
@@ -86,7 +86,7 @@
 
   $ hg --encoding latin-1 log
   changeset:   5:093c6077d1c8
-  branch:      
+  branch:      \xe9 (esc)
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -95,35 +95,35 @@
   changeset:   4:94db611b4196
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     Added tag  for changeset ca661e7520de
+  summary:     Added tag \xe9 for changeset ca661e7520de (esc)
   
   changeset:   3:ca661e7520de
-  tag:         
+  tag:         \xe9 (esc)
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     utf-8 e' encoded: 
+  summary:     utf-8 e' encoded: \xe9 (esc)
   
   changeset:   2:650c6f3d55dd
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     latin-1 e' encoded: 
+  summary:     latin-1 e' encoded: \xe9 (esc)
   
   changeset:   1:0e5b7e3f9c4a
   user:        test
   date:        Mon Jan 12 13:46:40 1970 +0000
-  summary:     koi8-r:  = u'\u0440\u0442\u0443\u0442\u044c'
+  summary:     koi8-r: \xd2\xd4\xd5\xd4\xd8 = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
   
   changeset:   0:1e78a93102a3
   user:        test
   date:        Mon Jan 12 13:46:40 1970 +0000
-  summary:     latin-1 e':  = u'\xe9'
+  summary:     latin-1 e': \xe9 = u'\\xe9' (esc)
   
 
 hg log (utf-8)
 
   $ hg --encoding utf-8 log
   changeset:   5:093c6077d1c8
-  branch:      é
+  branch:      \xc3\xa9 (esc)
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -132,28 +132,28 @@
   changeset:   4:94db611b4196
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     Added tag é for changeset ca661e7520de
+  summary:     Added tag \xc3\xa9 for changeset ca661e7520de (esc)
   
   changeset:   3:ca661e7520de
-  tag:         é
+  tag:         \xc3\xa9 (esc)
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     utf-8 e' encoded: é
+  summary:     utf-8 e' encoded: \xc3\xa9 (esc)
   
   changeset:   2:650c6f3d55dd
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     latin-1 e' encoded: é
+  summary:     latin-1 e' encoded: \xc3\xa9 (esc)
   
   changeset:   1:0e5b7e3f9c4a
   user:        test
   date:        Mon Jan 12 13:46:40 1970 +0000
-  summary:     koi8-r: ÒÔÕÔØ = u'\u0440\u0442\u0443\u0442\u044c'
+  summary:     koi8-r: \xc3\x92\xc3\x94\xc3\x95\xc3\x94\xc3\x98 = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
   
   changeset:   0:1e78a93102a3
   user:        test
   date:        Mon Jan 12 13:46:40 1970 +0000
-  summary:     latin-1 e': é = u'\xe9'
+  summary:     latin-1 e': \xc3\xa9 = u'\\xe9' (esc)
   
 
 hg tags (ascii)
@@ -166,13 +166,13 @@
 
   $ HGENCODING=latin-1 hg tags
   tip                                5:093c6077d1c8
-                                    3:ca661e7520de
+  \xe9                                  3:ca661e7520de (esc)
 
 hg tags (utf-8)
 
   $ HGENCODING=utf-8 hg tags
   tip                                5:093c6077d1c8
-  é                                  3:ca661e7520de
+  \xc3\xa9                                  3:ca661e7520de (esc)
 
 hg branches (ascii)
 
@@ -183,13 +183,13 @@
 hg branches (latin-1)
 
   $ HGENCODING=latin-1 hg branches
-                                5:093c6077d1c8
+  \xe9                              5:093c6077d1c8 (esc)
   default                        4:94db611b4196 (inactive)
 
 hg branches (utf-8)
 
   $ HGENCODING=utf-8 hg branches
-  é                              5:093c6077d1c8
+  \xc3\xa9                              5:093c6077d1c8 (esc)
   default                        4:94db611b4196 (inactive)
   $ echo '[ui]' >> .hg/hgrc
   $ echo 'fallbackencoding = koi8-r' >> .hg/hgrc
@@ -198,7 +198,7 @@
 
   $ HGENCODING=utf-8 hg log
   changeset:   5:093c6077d1c8
-  branch:      é
+  branch:      \xc3\xa9 (esc)
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -207,28 +207,28 @@
   changeset:   4:94db611b4196
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     Added tag é for changeset ca661e7520de
+  summary:     Added tag \xc3\xa9 for changeset ca661e7520de (esc)
   
   changeset:   3:ca661e7520de
-  tag:         é
+  tag:         \xc3\xa9 (esc)
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     utf-8 e' encoded: é
+  summary:     utf-8 e' encoded: \xc3\xa9 (esc)
   
   changeset:   2:650c6f3d55dd
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     latin-1 e' encoded: é
+  summary:     latin-1 e' encoded: \xc3\xa9 (esc)
   
   changeset:   1:0e5b7e3f9c4a
   user:        test
   date:        Mon Jan 12 13:46:40 1970 +0000
-  summary:     koi8-r: ртуть = u'\u0440\u0442\u0443\u0442\u044c'
+  summary:     koi8-r: \xd1\x80\xd1\x82\xd1\x83\xd1\x82\xd1\x8c = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
   
   changeset:   0:1e78a93102a3
   user:        test
   date:        Mon Jan 12 13:46:40 1970 +0000
-  summary:     latin-1 e': И = u'\xe9'
+  summary:     latin-1 e': \xd0\x98 = u'\\xe9' (esc)
   
 
 hg log (dolphin)
@@ -237,7 +237,7 @@
   abort: unknown encoding: dolphin, please check your locale settings
   [255]
   $ HGENCODING=ascii hg branch `cat latin-1-tag`
-  abort: decoding near '': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)!
+  abort: decoding near '\xe9': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)! (esc)
   [255]
   $ cp latin-1-tag .hg/branch
   $ HGENCODING=latin-1 hg ci -m 'should fail'
--- a/tests/test-eol-add.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-eol-add.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-eol-clone.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-eol-patch.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-eol-update.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-eol.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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-eolfilename.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-eolfilename.t	Sun Nov 07 19:42:42 2010 -0600
@@ -9,11 +9,11 @@
   $ A=`printf 'he\rllo'`
   $ echo foo > "$A"
   $ hg add
-  adding he
llo
+  adding he\rllo (esc)
   abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
   [255]
   $ hg ci -A -m m
-  adding he
llo
+  adding he\rllo (esc)
   abort: '\n' and '\r' disallowed in filenames: 'he\rllo'
   [255]
   $ rm "$A"
@@ -31,7 +31,7 @@
   [255]
   $ echo foo > "$A"
   $ hg debugwalk
-  f  he
llo  he
llo
+  f  he\rllo  he\rllo (esc)
   f  hell
   o  hell
   o
@@ -51,7 +51,7 @@
   $ touch "$A"
   $ touch "$B"
   $ hg status --color=always
-  ? foo
-  bar
-  ? foo
-  bar.baz
+  \x1b[0;35;1;4m? foo\x1b[0m (esc)
+  \x1b[0;35;1;4mbar\x1b[0m (esc)
+  \x1b[0;35;1;4m? foo\x1b[0m (esc)
+  \x1b[0;35;1;4mbar.baz\x1b[0m (esc)
--- a/tests/test-git-import.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-git-import.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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-grep.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-grep.t	Sun Nov 07 19:42:42 2010 -0600
@@ -33,9 +33,9 @@
 
   $ hg --config extensions.color= grep --config color.mode=ansi \
   >     --color=always port port
-  port:4:export
-  port:4:vaportight
-  port:4:import/export
+  port:4:ex\x1b[0;31;1mport\x1b[0m (esc)
+  port:4:va\x1b[0;31;1mport\x1b[0might (esc)
+  port:4:im\x1b[0;31;1mport\x1b[0m/export (esc)
 
 all
 
--- a/tests/test-hgweb-commands.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-hgweb-commands.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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\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
-  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\x8ceY\xf7\xa2KO\xd2\xb7K\x16~\
-  \xe9\xad\x90w\x86\xab\x93W\x8e\xdf\xb0r\\Y\xee6(\xa2)\xf6\x95\xc6\x01\xe4\x1az\x80R\xe8kN\x98\xe7R\xa4\xa9K@\xe0!A\xb4k\xa7U*m\x03\x07\xd8\x92\x1d\xd2\xc9\xa4\x1d\xc2\xe6,\xa5\xcc+\x1f\xef\xafDgi\xef\xab\x1d\x1d\xb7\x9a\xe7[W\xfbc\x8f\xde-\xcd\xe7\xcaz\xb3\xbb\x19\xd3\x81\x10>c>\x08\x00"X\x11\xc2\x84@\xd2\xe7B*L\x00\x01P\x04R\xc3@\xbaB0\xdb8#\x83:\x83\xa2h\xbc=\xcd\xdaS\xe1Y,L\xd3\xa0\xf2\xa8\x94J:\xe6\xd8\x81Q\xe0\xe8d\xa7#\xe2,\xd1\xaeR*\xed \xa5\x01\x13\x01\xa6\x0cb\xe3;\xbe\xaf\xfcK[^wK\xe1N\xaf\xbbk\xe8B\xd1\xf4\xc1\x07\xb3\xab[\x10\xfdkmvwcB\xa6\xa4\xd4G\xc4D\xc2\x141\xad\x91\x10\x00\x08J\x81\xcb}\xee\t\xee+W\xba\x8a\x80\x90|\xd4\xa0\xd6\xa0\xd4T\xde\xe1\x9d,!\xe2\xb5\xa94\xe3\xe7\xd5\x9f\x06\x18\xcba\x03aP\xb8f\xcd\x04\x1a_\\9\xf1\xed\xe4\x9e\xe5\xa6\xd1\xd2\x9f\x03\xa7o\xae\x90H\xf3\xfb\xef\xffH3\xadk
-  \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\x8ceY\xf7\xa2KO\xd2\xb7K\x16~\\n\xe9\xad\x90w\x86\xab\x93W\x8e\xdf\xb0r\\Y\xee6(\xa2)\xf6\x95\xc6\x01\xe4\x1az\x80R\xe8kN\x98\xe7R\xa4\xa9K@\xe0!A\xb4k\xa7U*m\x03\x07\xd8\x92\x1d\xd2\xc9\xa4\x1d\xc2\xe6,\xa5\xcc+\x1f\xef\xafDgi\xef\xab\x1d\x1d\xb7\x9a\xe7[W\xfbc\x8f\xde-\xcd\xe7\xcaz\xb3\xbb\x19\xd3\x81\x10>c>\x08\x00"X\x11\xc2\x84@\xd2\xe7B*L\x00\x01P\x04R\xc3@\xbaB0\xdb8#\x83:\x83\xa2h\xbc=\xcd\xdaS\xe1Y,L\xd3\xa0\xf2\xa8\x94J:\xe6\xd8\x81Q\xe0\xe8d\xa7#\xe2,\xd1\xaeR*\xed \xa5\x01\x13\x01\xa6\x0cb\xe3;\xbe\xaf\xfcK[^wK\xe1N\xaf\xbbk\xe8B\xd1\xf4\xc1\x07\xb3\xab[\x10\xfdkmvwcB\xa6\xa4\xd4G\xc4D\xc2\x141\xad\x91\x10\x00\x08J\x81\xcb}\xee	\xee+W\xba\x8a\x80\x90|\xd4\xa0\xd6\xa0\xd4T\xde\xe1\x9d,!\xe2\xb5\xa94\xe3\xe7\xd5\x9f\x06\x18\xcba\x03aP\xb8f\xcd\x04\x1a_\\9\xf1\xed\xe4\x9e\xe5\xa6\xd1\xd2\x9f\x03\xa7o\xae\x90H\xf3\xfb\xef\xffH3\xadk (esc)
+  \xb0\x90\x92\x88\xb9\x14"\x068\xc2\x1e@\x00\xbb\x8a)\xd3'\x859 (esc)
+  \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	_\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	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-highlight.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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-http-branchmap.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-http-branchmap.t	Sun Nov 07 19:42:42 2010 -0600
@@ -5,7 +5,7 @@
   > }
   $ hg init a
   $ hg --encoding utf-8 -R a branch æ
-  marked working directory as branch æ
+  marked working directory as branch \xc3\xa6 (esc)
   $ echo foo > a/foo
   $ hg -R a ci -Am foo
   adding foo
@@ -17,11 +17,11 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  updating to branch æ
+  updating to branch \xc3\xa6 (esc)
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg --encoding utf-8 -R b log
   changeset:   0:867c11ce77b8
-  branch:      æ
+  branch:      \xc3\xa6 (esc)
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -38,14 +38,14 @@
   remote: added 1 changesets with 1 changes to 1 files
   $ hg -R a --encoding utf-8 log
   changeset:   1:58e7c90d67cb
-  branch:      æ
+  branch:      \xc3\xa6 (esc)
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     bar
   
   changeset:   0:867c11ce77b8
-  branch:      æ
+  branch:      \xc3\xa6 (esc)
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     foo
--- a/tests/test-import-eol.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-import-eol.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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-import.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-import.t	Sun Nov 07 19:42:42 2010 -0600
@@ -440,8 +440,8 @@
 
 import with --no-commit should have written .hg/last-message.txt
 
-  $ printf '\n' | cat .hg/last-message.txt -
-  change
+  $ cat .hg/last-message.txt
+  change (no-eol)
 
 
 test fuzziness with eol=auto
--- a/tests/test-log.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-log.t	Sun Nov 07 19:42:42 2010 -0600
@@ -523,31 +523,31 @@
 
   $ hg --config extensions.color= --config color.mode=ansi \
   >  log -p -l2 --color=always
-  changeset:   6:2404bbcab562
+  \x1b[0;33mchangeset:   6:2404bbcab562\x1b[0m (esc)
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:01 1970 +0000
   summary:     b1.1
   
-  diff -r 302e9dd6890d -r 2404bbcab562 b1
-  --- a/b1	Thu Jan 01 00:00:01 1970 +0000
-  +++ b/b1	Thu Jan 01 00:00:01 1970 +0000
-  @@ -1,1 +1,2 @@
+  \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
+  \x1b[0;31;1m--- a/b1	Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
+  \x1b[0;32;1m+++ b/b1	Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
+  \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
    b1
-  +postm
+  \x1b[0;32m+postm\x1b[0m (esc)
   
-  changeset:   5:302e9dd6890d
+  \x1b[0;33mchangeset:   5:302e9dd6890d\x1b[0m (esc)
   parent:      3:e62f78d544b4
   parent:      4:ddb82e70d1a1
   user:        test
   date:        Thu Jan 01 00:00:01 1970 +0000
   summary:     m12
   
-  diff -r e62f78d544b4 -r 302e9dd6890d b2
-  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-  +++ b/b2	Thu Jan 01 00:00:01 1970 +0000
-  @@ -0,0 +1,1 @@
-  +b2
+  \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
+  \x1b[0;31;1m--- /dev/null	Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
+  \x1b[0;32;1m+++ b/b2	Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
+  \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
+  \x1b[0;32m+b2\x1b[0m (esc)
   
 
 
--- a/tests/test-mq-guards.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-mq-guards.t	Sun Nov 07 19:42:42 2010 -0600
@@ -218,9 +218,9 @@
 
   $ hg --config extensions.color= qguard --config color.mode=ansi \
   >     -l --color=always
-  a.patch: +1 +2 -3
-  b.patch: +2
-  c.patch: unguarded
+  \x1b[0;30;1ma.patch\x1b[0m: \x1b[0;33m+1\x1b[0m \x1b[0;33m+2\x1b[0m \x1b[0;31m-3\x1b[0m (esc)
+  \x1b[0;34;1;4mb.patch\x1b[0m: \x1b[0;33m+2\x1b[0m (esc)
+  \x1b[0;30;1mc.patch\x1b[0m: \x1b[0;32munguarded\x1b[0m (esc)
 
 should pop b.patch
 
@@ -310,10 +310,10 @@
 qseries again, but with color
 
   $ hg --config extensions.color= qseries -v --color=always
-  0 G new.patch
-  1 G b.patch
-  2 A c.patch
-  3 U d.patch
+  0 G \x1b[0;30;1mnew.patch\x1b[0m (esc)
+  1 G \x1b[0;30;1mb.patch\x1b[0m (esc)
+  2 A \x1b[0;34;1;4mc.patch\x1b[0m (esc)
+  3 U \x1b[0;30;1md.patch\x1b[0m (esc)
 
   $ hg qguard d.patch +2
 
@@ -433,4 +433,4 @@
 hg qseries -m with color
 
   $ hg --config extensions.color= qseries -m --color=always
-  b.patch
+  \x1b[0;31;1mb.patch\x1b[0m (esc)
--- a/tests/test-mq-qpush-fail.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-mq-qpush-fail.t	Sun Nov 07 19:42:42 2010 -0600
@@ -41,7 +41,7 @@
   transaction abort!
   rollback completed
   cleaning up working directory...done
-  abort: decoding near '': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)!
+  abort: decoding near '\xe9': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)! (esc)
   [255]
   $ hg parents
   changeset:   0:bbd179dfa0a7
--- a/tests/test-mq.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-mq.t	Sun Nov 07 19:42:42 2010 -0600
@@ -178,11 +178,11 @@
 status --mq with color (issue2096)
 
   $ hg status --mq --config extensions.color= --color=always
-  A .hgignore
-  A A
-  A B
-  A series
-  ? flaf
+  \x1b[0;32;1mA .hgignore\x1b[0m (esc)
+  \x1b[0;32;1mA A\x1b[0m (esc)
+  \x1b[0;32;1mA B\x1b[0m (esc)
+  \x1b[0;32;1mA series\x1b[0m (esc)
+  \x1b[0;35;1;4m? flaf\x1b[0m (esc)
 
 try the --mq option on a command provided by an extension
 
--- a/tests/test-patchbomb.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-patchbomb.t	Sun Nov 07 19:42:42 2010 -0600
@@ -148,7 +148,7 @@
   $ hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip \
   > --config extensions.progress= --config progress.assume-tty=1 \
   > --config progress.delay=0 --config progress.refresh=0
-  \rwriting [                                                                 ] 0/3\rwriting [                                                                 ] 0/3\r                                                                                \r\r                                                                                \r\rwriting [====================>                                            ] 1/3\rwriting [====================>                                            ] 1/3\r                                                                                \r\r                                                                                \r\rwriting [==========================================>                      ] 2/3\rwriting [==========================================>                      ] 2/3\r                                                                                \rThis patch series consists of 2 patches.
+  \rwriting [                                                                 ] 0/3\rwriting [                                                                 ] 0/3\r                                                                                \r\r                                                                                \r\rwriting [====================>                                            ] 1/3\rwriting [====================>                                            ] 1/3\r                                                                                \r\r                                                                                \r\rwriting [==========================================>                      ] 2/3\rwriting [==========================================>                      ] 2/3\r                                                                                \rThis patch series consists of 2 patches. (esc)
   
   
   Write the introductory message for the patch series.
@@ -1925,7 +1925,7 @@
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/utf	Thu Jan 01 00:00:04 1970 +0000
   @@ -0,0 +1,1 @@
-  +hömma!
+  +h\xc3\xb6mma! (esc)
   
   Displaying [PATCH 3 of 8] charset=utf-8; content-transfer-encoding: quoted-printable ...
   Content-Type: text/plain; charset="us-ascii"
@@ -1996,7 +1996,7 @@
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/isolatin	Thu Jan 01 00:00:05 1970 +0000
   @@ -0,0 +1,1 @@
-  +hmma!
+  +h\xf6mma! (esc)
   
   Displaying [PATCH 5 of 8] Added tag zero, zero.foo for changeset 8580ff50825a ...
   Content-Type: text/plain; charset="us-ascii"
--- a/tests/test-progress.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-progress.t	Sun Nov 07 19:42:42 2010 -0600
@@ -51,7 +51,7 @@
   loop [                                                                    ] 0/3
   loop [=====================>                                              ] 1/3
   loop [============================================>                       ] 2/3
-                                                                                  
+                                                                                  \r (esc)
 
 test refresh is taken in account
 
@@ -64,7 +64,7 @@
   
   0/2 loop lo
   1/2 loop lo
-                                                                                  
+                                                                                  \r (esc)
 
 test format options 2
 
@@ -72,7 +72,7 @@
   
   0/2 p.0 [                                                                     ]
   1/2 p.1 [=================================>                                   ]
-                                                                                  
+                                                                                  \r (esc)
 
 test format options and indeterminate progress
 
@@ -80,7 +80,7 @@
   
   0 loop.0               [ <=>                                                  ]
   1 loop.1               [  <=>                                                 ]
-                                                                                  
+                                                                                  \r (esc)
 
 make sure things don't fall over if count > total
 
@@ -92,7 +92,7 @@
   loop [==================================================>                 ] 3/4
   loop [===================================================================>] 4/4
   loop [ <=>                                                                ] 5/4
-                                                                                  
+                                                                                  \r (esc)
 
 test immediate progress completion
 
--- a/tests/test-qrecord.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-qrecord.t	Sun Nov 07 19:42:42 2010 -0600
@@ -302,5 +302,3 @@
 After qrecord b.patch 'diff'
 
   $ hg diff --nodates
-
-End
\ No newline at end of file
--- a/tests/test-revset.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-revset.t	Sun Nov 07 19:42:42 2010 -0600
@@ -66,7 +66,7 @@
   $ hg co 4
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg branch é
-  marked working directory as branch é
+  marked working directory as branch \xc3\xa9 (esc)
   $ hg ci -Aqm9
 
   $ hg tag -r6 1.0
--- a/tests/test-run-tests.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-run-tests.t	Sun Nov 07 19:42:42 2010 -0600
@@ -2,6 +2,8 @@
 
   $ echo foo
   foo
+  $ printf 'oh no'
+  oh no (no-eol)
   $ printf 'bar\nbaz\n' | cat
   bar
   baz
--- a/tests/test-simplemerge-cmd.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-simplemerge-cmd.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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-status-color.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-status-color.t	Sun Nov 07 19:42:42 2010 -0600
@@ -11,100 +11,100 @@
 hg status in repo root:
 
   $ hg status --color=always
-  ? a/1/in_a_1
-  ? a/in_a
-  ? b/1/in_b_1
-  ? b/2/in_b_2
-  ? b/in_b
-  ? in_root
+  \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_root\x1b[0m (esc)
 
 hg status . in repo root:
 
   $ hg status --color=always .
-  ? a/1/in_a_1
-  ? a/in_a
-  ? b/1/in_b_1
-  ? b/2/in_b_2
-  ? b/in_b
-  ? in_root
+  \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_root\x1b[0m (esc)
 
   $ hg status --color=always --cwd a
-  ? a/1/in_a_1
-  ? a/in_a
-  ? b/1/in_b_1
-  ? b/2/in_b_2
-  ? b/in_b
-  ? in_root
+  \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_root\x1b[0m (esc)
   $ hg status --color=always --cwd a .
-  ? 1/in_a_1
-  ? in_a
+  \x1b[0;35;1;4m? 1/in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_a\x1b[0m (esc)
   $ hg status --color=always --cwd a ..
-  ? 1/in_a_1
-  ? in_a
-  ? ../b/1/in_b_1
-  ? ../b/2/in_b_2
-  ? ../b/in_b
-  ? ../in_root
+  \x1b[0;35;1;4m? 1/in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_a\x1b[0m (esc)
+  \x1b[0;35;1;4m? ../b/1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? ../b/2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? ../b/in_b\x1b[0m (esc)
+  \x1b[0;35;1;4m? ../in_root\x1b[0m (esc)
 
   $ hg status --color=always --cwd b
-  ? a/1/in_a_1
-  ? a/in_a
-  ? b/1/in_b_1
-  ? b/2/in_b_2
-  ? b/in_b
-  ? in_root
+  \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_root\x1b[0m (esc)
   $ hg status --color=always --cwd b .
-  ? 1/in_b_1
-  ? 2/in_b_2
-  ? in_b
+  \x1b[0;35;1;4m? 1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? 2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_b\x1b[0m (esc)
   $ hg status --color=always --cwd b ..
-  ? ../a/1/in_a_1
-  ? ../a/in_a
-  ? 1/in_b_1
-  ? 2/in_b_2
-  ? in_b
-  ? ../in_root
+  \x1b[0;35;1;4m? ../a/1/in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? ../a/in_a\x1b[0m (esc)
+  \x1b[0;35;1;4m? 1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? 2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_b\x1b[0m (esc)
+  \x1b[0;35;1;4m? ../in_root\x1b[0m (esc)
 
   $ hg status --color=always --cwd a/1
-  ? a/1/in_a_1
-  ? a/in_a
-  ? b/1/in_b_1
-  ? b/2/in_b_2
-  ? b/in_b
-  ? in_root
+  \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_root\x1b[0m (esc)
   $ hg status --color=always --cwd a/1 .
-  ? in_a_1
+  \x1b[0;35;1;4m? in_a_1\x1b[0m (esc)
   $ hg status --color=always --cwd a/1 ..
-  ? in_a_1
-  ? ../in_a
+  \x1b[0;35;1;4m? in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? ../in_a\x1b[0m (esc)
 
   $ hg status --color=always --cwd b/1
-  ? a/1/in_a_1
-  ? a/in_a
-  ? b/1/in_b_1
-  ? b/2/in_b_2
-  ? b/in_b
-  ? in_root
+  \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_root\x1b[0m (esc)
   $ hg status --color=always --cwd b/1 .
-  ? in_b_1
+  \x1b[0;35;1;4m? in_b_1\x1b[0m (esc)
   $ hg status --color=always --cwd b/1 ..
-  ? in_b_1
-  ? ../2/in_b_2
-  ? ../in_b
+  \x1b[0;35;1;4m? in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? ../2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? ../in_b\x1b[0m (esc)
 
   $ hg status --color=always --cwd b/2
-  ? a/1/in_a_1
-  ? a/in_a
-  ? b/1/in_b_1
-  ? b/2/in_b_2
-  ? b/in_b
-  ? in_root
+  \x1b[0;35;1;4m? a/1/in_a_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? a/in_a\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/2/in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? b/in_b\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_root\x1b[0m (esc)
   $ hg status --color=always --cwd b/2 .
-  ? in_b_2
+  \x1b[0;35;1;4m? in_b_2\x1b[0m (esc)
   $ hg status --color=always --cwd b/2 ..
-  ? ../1/in_b_1
-  ? in_b_2
-  ? ../in_b
+  \x1b[0;35;1;4m? ../1/in_b_1\x1b[0m (esc)
+  \x1b[0;35;1;4m? in_b_2\x1b[0m (esc)
+  \x1b[0;35;1;4m? ../in_b\x1b[0m (esc)
   $ cd ..
 
   $ hg init repo2
@@ -124,44 +124,44 @@
 hg status:
 
   $ hg status --color=always
-  A added
-  R removed
-  ! deleted
-  ? unknown
+  \x1b[0;32;1mA added\x1b[0m (esc)
+  \x1b[0;31;1mR removed\x1b[0m (esc)
+  \x1b[0;36;1;4m! deleted\x1b[0m (esc)
+  \x1b[0;35;1;4m? unknown\x1b[0m (esc)
 
 hg status modified added removed deleted unknown never-existed ignored:
 
   $ hg status --color=always modified added removed deleted unknown never-existed ignored
   never-existed: No such file or directory
-  A added
-  R removed
-  ! deleted
-  ? unknown
+  \x1b[0;32;1mA added\x1b[0m (esc)
+  \x1b[0;31;1mR removed\x1b[0m (esc)
+  \x1b[0;36;1;4m! deleted\x1b[0m (esc)
+  \x1b[0;35;1;4m? unknown\x1b[0m (esc)
 
   $ hg copy modified copied
 
 hg status -C:
 
   $ hg status --color=always -C
-  A added
-  A copied
-    modified
-  R removed
-  ! deleted
-  ? unknown
+  \x1b[0;32;1mA added\x1b[0m (esc)
+  \x1b[0;32;1mA copied\x1b[0m (esc)
+  \x1b[0;0m  modified\x1b[0m (esc)
+  \x1b[0;31;1mR removed\x1b[0m (esc)
+  \x1b[0;36;1;4m! deleted\x1b[0m (esc)
+  \x1b[0;35;1;4m? unknown\x1b[0m (esc)
 
 hg status -A:
 
   $ hg status --color=always -A
-  A added
-  A copied
-    modified
-  R removed
-  ! deleted
-  ? unknown
-  I ignored
-  C .hgignore
-  C modified
+  \x1b[0;32;1mA added\x1b[0m (esc)
+  \x1b[0;32;1mA copied\x1b[0m (esc)
+  \x1b[0;0m  modified\x1b[0m (esc)
+  \x1b[0;31;1mR removed\x1b[0m (esc)
+  \x1b[0;36;1;4m! deleted\x1b[0m (esc)
+  \x1b[0;35;1;4m? unknown\x1b[0m (esc)
+  \x1b[0;30;1mI ignored\x1b[0m (esc)
+  \x1b[0;0mC .hgignore\x1b[0m (esc)
+  \x1b[0;0mC modified\x1b[0m (esc)
 
 
   $ echo "^ignoreddir$" > .hgignore
@@ -175,7 +175,7 @@
 hg status -i ignoreddir/file:
 
   $ hg status --color=always -i ignoreddir/file
-  I ignoreddir/file
+  \x1b[0;30;1mI ignoreddir/file\x1b[0m (esc)
   $ cd ..
 
 check 'status -q' and some combinations
@@ -201,11 +201,11 @@
   $ hg --config color.status.modified=periwinkle status --color=always
   ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
   M modified
-  A added
-  A copied
-  R removed
-  ! deleted
-  ? unknown
+  \x1b[0;32;1mA added\x1b[0m (esc)
+  \x1b[0;32;1mA copied\x1b[0m (esc)
+  \x1b[0;31;1mR removed\x1b[0m (esc)
+  \x1b[0;36;1;4m! deleted\x1b[0m (esc)
+  \x1b[0;35;1;4m? unknown\x1b[0m (esc)
 
 Run status with 2 different flags.
 Check if result is the same or different.
@@ -275,5 +275,5 @@
 hg resolve with one unresolved, one resolved:
 
   $ hg resolve --color=always -l
-  U a
-  R b
+  \x1b[0;31;1mU a\x1b[0m (esc)
+  \x1b[0;32;1mR b\x1b[0m (esc)
--- a/tests/test-transplant.t	Sun Nov 07 16:01:57 2010 -0600
+++ b/tests/test-transplant.t	Sun Nov 07 19:42:42 2010 -0600
@@ -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 ..