##// END OF EJS Templates
tests: use small conditional section for tic requirement in test-status-color.t...
Mads Kiilerich -
r20387:16c643f3 default
parent child Browse files
Show More
@@ -1,319 +1,322 b''
1 $ "$TESTDIR/hghave" tic || exit 80
2
3 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "color=" >> $HGRCPATH
2 $ echo "color=" >> $HGRCPATH
5 $ echo "[color]" >> $HGRCPATH
3 $ echo "[color]" >> $HGRCPATH
6 $ echo "mode=ansi" >> $HGRCPATH
4 $ echo "mode=ansi" >> $HGRCPATH
7 Terminfo codes compatibility fix
5 Terminfo codes compatibility fix
8 $ echo "color.none=0" >> $HGRCPATH
6 $ echo "color.none=0" >> $HGRCPATH
9
7
10 $ hg init repo1
8 $ hg init repo1
11 $ cd repo1
9 $ cd repo1
12 $ mkdir a b a/1 b/1 b/2
10 $ mkdir a b a/1 b/1 b/2
13 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
11 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
14
12
15 hg status in repo root:
13 hg status in repo root:
16
14
17 $ hg status --color=always
15 $ hg status --color=always
18 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
16 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
19 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
17 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
20 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
18 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
21 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
19 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
22 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
20 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
23 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
21 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
24
22
25 hg status . in repo root:
23 hg status . in repo root:
26
24
27 $ hg status --color=always .
25 $ hg status --color=always .
28 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
26 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
29 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
27 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
30 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
28 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
31 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
29 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
32 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
30 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
33 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
31 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
34
32
35 $ hg status --color=always --cwd a
33 $ hg status --color=always --cwd a
36 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
34 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
37 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
35 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
38 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
36 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
39 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
37 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
40 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
38 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
41 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
39 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
42 $ hg status --color=always --cwd a .
40 $ hg status --color=always --cwd a .
43 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
41 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
44 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
42 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
45 $ hg status --color=always --cwd a ..
43 $ hg status --color=always --cwd a ..
46 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
44 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
47 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
45 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
48 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc)
46 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc)
49 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/2/in_b_2\x1b[0m (esc)
47 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/2/in_b_2\x1b[0m (esc)
50 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc)
48 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc)
51 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
49 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
52
50
53 $ hg status --color=always --cwd b
51 $ hg status --color=always --cwd b
54 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
52 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
55 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
53 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
56 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
54 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
57 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
55 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
58 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
56 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
59 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
57 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
60 $ hg status --color=always --cwd b .
58 $ hg status --color=always --cwd b .
61 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
59 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
62 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
60 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
61 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
64 $ hg status --color=always --cwd b ..
62 $ hg status --color=always --cwd b ..
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc)
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc)
66 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc)
64 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc)
67 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
68 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
66 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
69 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
67 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
70 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
68 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
71
69
72 $ hg status --color=always --cwd a/1
70 $ hg status --color=always --cwd a/1
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
72 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
75 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
77 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
75 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
78 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
79 $ hg status --color=always --cwd a/1 .
77 $ hg status --color=always --cwd a/1 .
80 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
78 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
81 $ hg status --color=always --cwd a/1 ..
79 $ hg status --color=always --cwd a/1 ..
82 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
80 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
83 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc)
81 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc)
84
82
85 $ hg status --color=always --cwd b/1
83 $ hg status --color=always --cwd b/1
86 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
84 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
87 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
85 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
88 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
86 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
89 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
87 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
90 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
88 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
91 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
89 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
92 $ hg status --color=always --cwd b/1 .
90 $ hg status --color=always --cwd b/1 .
93 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
91 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
94 $ hg status --color=always --cwd b/1 ..
92 $ hg status --color=always --cwd b/1 ..
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
93 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
96 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc)
94 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc)
97 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
98
96
99 $ hg status --color=always --cwd b/2
97 $ hg status --color=always --cwd b/2
100 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
98 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
101 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
99 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
102 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
100 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
101 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
104 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
102 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
105 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
106 $ hg status --color=always --cwd b/2 .
104 $ hg status --color=always --cwd b/2 .
107 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
105 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
108 $ hg status --color=always --cwd b/2 ..
106 $ hg status --color=always --cwd b/2 ..
109 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc)
107 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc)
110 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
108 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
111 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
109 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
112
110
113 Make sure --color=never works
111 Make sure --color=never works
114 $ hg status --color=never
112 $ hg status --color=never
115 ? a/1/in_a_1
113 ? a/1/in_a_1
116 ? a/in_a
114 ? a/in_a
117 ? b/1/in_b_1
115 ? b/1/in_b_1
118 ? b/2/in_b_2
116 ? b/2/in_b_2
119 ? b/in_b
117 ? b/in_b
120 ? in_root
118 ? in_root
121
119
122 Make sure ui.formatted=False works
120 Make sure ui.formatted=False works
123 $ hg status --config ui.formatted=False
121 $ hg status --config ui.formatted=False
124 ? a/1/in_a_1
122 ? a/1/in_a_1
125 ? a/in_a
123 ? a/in_a
126 ? b/1/in_b_1
124 ? b/1/in_b_1
127 ? b/2/in_b_2
125 ? b/2/in_b_2
128 ? b/in_b
126 ? b/in_b
129 ? in_root
127 ? in_root
130
128
131 $ cd ..
129 $ cd ..
132
130
133 $ hg init repo2
131 $ hg init repo2
134 $ cd repo2
132 $ cd repo2
135 $ touch modified removed deleted ignored
133 $ touch modified removed deleted ignored
136 $ echo "^ignored$" > .hgignore
134 $ echo "^ignored$" > .hgignore
137 $ hg ci -A -m 'initial checkin'
135 $ hg ci -A -m 'initial checkin'
138 adding .hgignore
136 adding .hgignore
139 adding deleted
137 adding deleted
140 adding modified
138 adding modified
141 adding removed
139 adding removed
142 $ touch modified added unknown ignored
140 $ touch modified added unknown ignored
143 $ hg add added
141 $ hg add added
144 $ hg remove removed
142 $ hg remove removed
145 $ rm deleted
143 $ rm deleted
146
144
147 hg status:
145 hg status:
148
146
149 $ hg status --color=always
147 $ hg status --color=always
150 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
148 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
151 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
149 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
152 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
150 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
153 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
151 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
154
152
155 hg status modified added removed deleted unknown never-existed ignored:
153 hg status modified added removed deleted unknown never-existed ignored:
156
154
157 $ hg status --color=always modified added removed deleted unknown never-existed ignored
155 $ hg status --color=always modified added removed deleted unknown never-existed ignored
158 never-existed: * (glob)
156 never-existed: * (glob)
159 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
157 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
160 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
158 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
161 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
159 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
162 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
160 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
163
161
164 $ hg copy modified copied
162 $ hg copy modified copied
165
163
166 hg status -C:
164 hg status -C:
167
165
168 $ hg status --color=always -C
166 $ hg status --color=always -C
169 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
167 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
170 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
168 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
171 \x1b[0;0m modified\x1b[0m (esc)
169 \x1b[0;0m modified\x1b[0m (esc)
172 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
170 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
173 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
171 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
174 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
172 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
175
173
176 hg status -A:
174 hg status -A:
177
175
178 $ hg status --color=always -A
176 $ hg status --color=always -A
179 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
177 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
180 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
178 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
181 \x1b[0;0m modified\x1b[0m (esc)
179 \x1b[0;0m modified\x1b[0m (esc)
182 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
180 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
183 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
181 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
184 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
182 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
185 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc)
183 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc)
186 \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc)
184 \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc)
187 \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc)
185 \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc)
188
186
187
189 hg status -A (with terminfo color):
188 hg status -A (with terminfo color):
190
189
190 #if tic
191
191 $ mkdir "$TESTTMP/terminfo"
192 $ mkdir "$TESTTMP/terminfo"
192 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti"
193 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti"
193 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --color=always -A
194 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --color=always -A
194 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc)
195 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc)
195 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc)
196 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc)
196 \x1b[30m\x1b[30m modified\x1b[30m (esc)
197 \x1b[30m\x1b[30m modified\x1b[30m (esc)
197 \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc)
198 \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc)
198 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc)
199 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc)
199 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc)
200 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc)
200 \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc)
201 \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc)
201 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc)
202 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc)
202 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc)
203 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc)
203
204
205 #endif
206
204
207
205 $ echo "^ignoreddir$" > .hgignore
208 $ echo "^ignoreddir$" > .hgignore
206 $ mkdir ignoreddir
209 $ mkdir ignoreddir
207 $ touch ignoreddir/file
210 $ touch ignoreddir/file
208
211
209 hg status ignoreddir/file:
212 hg status ignoreddir/file:
210
213
211 $ hg status --color=always ignoreddir/file
214 $ hg status --color=always ignoreddir/file
212
215
213 hg status -i ignoreddir/file:
216 hg status -i ignoreddir/file:
214
217
215 $ hg status --color=always -i ignoreddir/file
218 $ hg status --color=always -i ignoreddir/file
216 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc)
219 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc)
217 $ cd ..
220 $ cd ..
218
221
219 check 'status -q' and some combinations
222 check 'status -q' and some combinations
220
223
221 $ hg init repo3
224 $ hg init repo3
222 $ cd repo3
225 $ cd repo3
223 $ touch modified removed deleted ignored
226 $ touch modified removed deleted ignored
224 $ echo "^ignored$" > .hgignore
227 $ echo "^ignored$" > .hgignore
225 $ hg commit -A -m 'initial checkin'
228 $ hg commit -A -m 'initial checkin'
226 adding .hgignore
229 adding .hgignore
227 adding deleted
230 adding deleted
228 adding modified
231 adding modified
229 adding removed
232 adding removed
230 $ touch added unknown ignored
233 $ touch added unknown ignored
231 $ hg add added
234 $ hg add added
232 $ echo "test" >> modified
235 $ echo "test" >> modified
233 $ hg remove removed
236 $ hg remove removed
234 $ rm deleted
237 $ rm deleted
235 $ hg copy modified copied
238 $ hg copy modified copied
236
239
237 test unknown color
240 test unknown color
238
241
239 $ hg --config color.status.modified=periwinkle status --color=always
242 $ hg --config color.status.modified=periwinkle status --color=always
240 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
243 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
241 M modified
244 M modified
242 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
245 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
243 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
246 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
244 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
247 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
245 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
248 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
246 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
249 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
247
250
248 Run status with 2 different flags.
251 Run status with 2 different flags.
249 Check if result is the same or different.
252 Check if result is the same or different.
250 If result is not as expected, raise error
253 If result is not as expected, raise error
251
254
252 $ assert() {
255 $ assert() {
253 > hg status --color=always $1 > ../a
256 > hg status --color=always $1 > ../a
254 > hg status --color=always $2 > ../b
257 > hg status --color=always $2 > ../b
255 > if diff ../a ../b > /dev/null; then
258 > if diff ../a ../b > /dev/null; then
256 > out=0
259 > out=0
257 > else
260 > else
258 > out=1
261 > out=1
259 > fi
262 > fi
260 > if [ $3 -eq 0 ]; then
263 > if [ $3 -eq 0 ]; then
261 > df="same"
264 > df="same"
262 > else
265 > else
263 > df="different"
266 > df="different"
264 > fi
267 > fi
265 > if [ $out -ne $3 ]; then
268 > if [ $out -ne $3 ]; then
266 > echo "Error on $1 and $2, should be $df."
269 > echo "Error on $1 and $2, should be $df."
267 > fi
270 > fi
268 > }
271 > }
269
272
270 assert flag1 flag2 [0-same | 1-different]
273 assert flag1 flag2 [0-same | 1-different]
271
274
272 $ assert "-q" "-mard" 0
275 $ assert "-q" "-mard" 0
273 $ assert "-A" "-marduicC" 0
276 $ assert "-A" "-marduicC" 0
274 $ assert "-qA" "-mardcC" 0
277 $ assert "-qA" "-mardcC" 0
275 $ assert "-qAui" "-A" 0
278 $ assert "-qAui" "-A" 0
276 $ assert "-qAu" "-marducC" 0
279 $ assert "-qAu" "-marducC" 0
277 $ assert "-qAi" "-mardicC" 0
280 $ assert "-qAi" "-mardicC" 0
278 $ assert "-qu" "-u" 0
281 $ assert "-qu" "-u" 0
279 $ assert "-q" "-u" 1
282 $ assert "-q" "-u" 1
280 $ assert "-m" "-a" 1
283 $ assert "-m" "-a" 1
281 $ assert "-r" "-d" 1
284 $ assert "-r" "-d" 1
282 $ cd ..
285 $ cd ..
283
286
284 test 'resolve -l'
287 test 'resolve -l'
285
288
286 $ hg init repo4
289 $ hg init repo4
287 $ cd repo4
290 $ cd repo4
288 $ echo "file a" > a
291 $ echo "file a" > a
289 $ echo "file b" > b
292 $ echo "file b" > b
290 $ hg add a b
293 $ hg add a b
291 $ hg commit -m "initial"
294 $ hg commit -m "initial"
292 $ echo "file a change 1" > a
295 $ echo "file a change 1" > a
293 $ echo "file b change 1" > b
296 $ echo "file b change 1" > b
294 $ hg commit -m "head 1"
297 $ hg commit -m "head 1"
295 $ hg update 0
298 $ hg update 0
296 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
299 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
297 $ echo "file a change 2" > a
300 $ echo "file a change 2" > a
298 $ echo "file b change 2" > b
301 $ echo "file b change 2" > b
299 $ hg commit -m "head 2"
302 $ hg commit -m "head 2"
300 created new head
303 created new head
301 $ hg merge
304 $ hg merge
302 merging a
305 merging a
303 warning: conflicts during merge.
306 warning: conflicts during merge.
304 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
307 merging a incomplete! (edit conflicts, then use 'hg resolve --mark')
305 merging b
308 merging b
306 warning: conflicts during merge.
309 warning: conflicts during merge.
307 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
310 merging b incomplete! (edit conflicts, then use 'hg resolve --mark')
308 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
311 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
309 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
312 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
310 [1]
313 [1]
311 $ hg resolve -m b
314 $ hg resolve -m b
312
315
313 hg resolve with one unresolved, one resolved:
316 hg resolve with one unresolved, one resolved:
314
317
315 $ hg resolve --color=always -l
318 $ hg resolve --color=always -l
316 \x1b[0;31;1mU a\x1b[0m (esc)
319 \x1b[0;31;1mU a\x1b[0m (esc)
317 \x1b[0;32;1mR b\x1b[0m (esc)
320 \x1b[0;32;1mR b\x1b[0m (esc)
318
321
319 $ cd ..
322 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now