Mercurial > hg > mercurial-source
comparison tests/test-diff-color.t @ 23172:e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Here document should be readable than repeating echo commands.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 04 Nov 2014 23:41:46 +0900 |
parents | 9ab18a912c44 |
children | c84a07530040 |
comparison
equal
deleted
inserted
replaced
23171:8afae1d5d108 | 23172:e955549cd045 |
---|---|
1 Setup | 1 Setup |
2 | 2 |
3 $ echo "[color]" >> $HGRCPATH | 3 $ cat <<EOF >> $HGRCPATH |
4 $ echo "mode = ansi" >> $HGRCPATH | 4 > [color] |
5 $ echo "[extensions]" >> $HGRCPATH | 5 > mode = ansi |
6 $ echo "color=" >> $HGRCPATH | 6 > [extensions] |
7 > color = | |
8 > EOF | |
7 $ hg init repo | 9 $ hg init repo |
8 $ cd repo | 10 $ cd repo |
9 $ cat > a <<EOF | 11 $ cat > a <<EOF |
10 > c | 12 > c |
11 > c | 13 > c |
64 diffstat | 66 diffstat |
65 | 67 |
66 $ hg diff --stat --color=always | 68 $ hg diff --stat --color=always |
67 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc) | 69 a | 2 \x1b[0;32m+\x1b[0m\x1b[0;31m-\x1b[0m (esc) |
68 1 files changed, 1 insertions(+), 1 deletions(-) | 70 1 files changed, 1 insertions(+), 1 deletions(-) |
69 $ echo "record=" >> $HGRCPATH | 71 $ cat <<EOF >> $HGRCPATH |
70 $ echo "[ui]" >> $HGRCPATH | 72 > record = |
71 $ echo "interactive=true" >> $HGRCPATH | 73 > [ui] |
72 $ echo "[diff]" >> $HGRCPATH | 74 > interactive = true |
73 $ echo "git=True" >> $HGRCPATH | 75 > [diff] |
76 > git = True | |
77 > EOF | |
74 | 78 |
75 #if execbit | 79 #if execbit |
76 | 80 |
77 record | 81 record |
78 | 82 |