comparison tests/test-diff-color.t @ 32103:9a98023ac8db stable

color: special case 'always' in 'ui.color' This lift the confusing case, where 'ui.color=always' would actually not always use color.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 02 May 2017 20:19:09 +0200
parents 9a85ea1daf49
children 1add41fc3c62
comparison
equal deleted inserted replaced
32102:9a85ea1daf49 32103:9a98023ac8db
1 Setup 1 Setup
2 2
3 $ cat <<EOF >> $HGRCPATH 3 $ cat <<EOF >> $HGRCPATH
4 > [ui] 4 > [ui]
5 > color = always 5 > color = yes
6 > formatted = always 6 > formatted = always
7 > [color] 7 > [color]
8 > mode = ansi 8 > mode = ansi
9 > EOF 9 > EOF
10 $ hg init repo 10 $ hg init repo
76 c 76 c
77 a 77 a
78 a 78 a
79 -b 79 -b
80 +dd 80 +dd
81 a
82 a
83 c
84
85 (check that 'ui.color=always' force color)
86
87 $ hg diff --nodates --config ui.formatted=no --config ui.color=always
88 \x1b[0;1mdiff -r cf9f4ba66af2 a\x1b[0m (esc)
89 \x1b[0;31;1m--- a/a\x1b[0m (esc)
90 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
91 \x1b[0;35m@@ -2,7 +2,7 @@\x1b[0m (esc)
92 c
93 a
94 a
95 \x1b[0;31m-b\x1b[0m (esc)
96 \x1b[0;32m+dd\x1b[0m (esc)
81 a 97 a
82 a 98 a
83 c 99 c
84 100
85 --unified=2 101 --unified=2