diff tests/test-status-color.t @ 13987:e0f07847f8de

color: add support for terminfo-based attributes and color Using terminfo instead of hard-coding ECMA-48 control sequences provides a greater assurance that the terminal codes are correct for the current terminal type; not everything supports the ANSI escape codes. It also allows us to use a wider range of colors when a terminal emulator supports it (such as 16- or 256-color xterm), and a few more non-color attributes, such as the ever-popular blink.
author Danek Duvall <duvall@comfychair.org>
date Thu, 21 Apr 2011 13:47:45 -0700
parents 05fffd665170
children b083d00578bf
line wrap: on
line diff
--- a/tests/test-status-color.t
+++ b/tests/test-status-color.t
@@ -163,6 +163,19 @@
   \x1b[0;0mC .hgignore\x1b[0m (esc)
   \x1b[0;0mC modified\x1b[0m (esc)
 
+hg status -A (with terminfo color):
+
+  $ TERM=xterm hg status --config color.mode=terminfo --color=always -A
+  \x1b(B\x1b[m\x1b[32m\x1b[1mA added\x1b(B\x1b[m (esc)
+  \x1b(B\x1b[m\x1b[32m\x1b[1mA copied\x1b(B\x1b[m (esc)
+  \x1b(B\x1b[m\x1b(B\x1b[m  modified\x1b(B\x1b[m (esc)
+  \x1b(B\x1b[m\x1b[31m\x1b[1mR removed\x1b(B\x1b[m (esc)
+  \x1b(B\x1b[m\x1b[36m\x1b[1m\x1b[4m! deleted\x1b(B\x1b[m (esc)
+  \x1b(B\x1b[m\x1b[35m\x1b[1m\x1b[4m? unknown\x1b(B\x1b[m (esc)
+  \x1b(B\x1b[m\x1b[30m\x1b[1mI ignored\x1b(B\x1b[m (esc)
+  \x1b(B\x1b[m\x1b(B\x1b[mC .hgignore\x1b(B\x1b[m (esc)
+  \x1b(B\x1b[m\x1b(B\x1b[mC modified\x1b(B\x1b[m (esc)
+
 
   $ echo "^ignoreddir$" > .hgignore
   $ mkdir ignoreddir