Show More
@@ -0,0 +1,36 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | echo "[extensions]" >> $HGRCPATH | |||
|
4 | echo "color=" >> $HGRCPATH | |||
|
5 | ||||
|
6 | hg init repo | |||
|
7 | cd repo | |||
|
8 | cat > a <<EOF | |||
|
9 | c | |||
|
10 | c | |||
|
11 | a | |||
|
12 | a | |||
|
13 | b | |||
|
14 | a | |||
|
15 | a | |||
|
16 | c | |||
|
17 | c | |||
|
18 | EOF | |||
|
19 | hg ci -Am adda | |||
|
20 | cat > a <<EOF | |||
|
21 | c | |||
|
22 | c | |||
|
23 | a | |||
|
24 | a | |||
|
25 | dd | |||
|
26 | a | |||
|
27 | a | |||
|
28 | c | |||
|
29 | c | |||
|
30 | EOF | |||
|
31 | ||||
|
32 | echo '% default context' | |||
|
33 | hg diff --nodates --color=always | |||
|
34 | ||||
|
35 | echo '% --unified=2' | |||
|
36 | hg diff --nodates -U 2 --color=always No newline at end of file |
@@ -0,0 +1,25 b'' | |||||
|
1 | adding a | |||
|
2 | % default context | |||
|
3 | [0;1mdiff -r cf9f4ba66af2 a[22;0m | |||
|
4 | [0;31;1m--- a/a[39;22;0m | |||
|
5 | [0;32;1m+++ b/a[39;22;0m | |||
|
6 | [0;35m@@ -2,7 +2,7 @@[39;0m | |||
|
7 | c | |||
|
8 | a | |||
|
9 | a | |||
|
10 | [0;31m-b[39;0m | |||
|
11 | [0;32m+dd[39;0m | |||
|
12 | a | |||
|
13 | a | |||
|
14 | c | |||
|
15 | % --unified=2 | |||
|
16 | [0;1mdiff -r cf9f4ba66af2 a[22;0m | |||
|
17 | [0;31;1m--- a/a[39;22;0m | |||
|
18 | [0;32;1m+++ b/a[39;22;0m | |||
|
19 | [0;35m@@ -3,5 +3,5 @@[39;0m | |||
|
20 | a | |||
|
21 | a | |||
|
22 | [0;31m-b[39;0m | |||
|
23 | [0;32m+dd[39;0m | |||
|
24 | a | |||
|
25 | a |
@@ -0,0 +1,97 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | echo "[extensions]" >> $HGRCPATH | |||
|
4 | echo "color=" >> $HGRCPATH | |||
|
5 | ||||
|
6 | hg init repo1 | |||
|
7 | cd repo1 | |||
|
8 | mkdir a b a/1 b/1 b/2 | |||
|
9 | touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2 | |||
|
10 | echo "hg status in repo root:" | |||
|
11 | hg status --color=always | |||
|
12 | echo "hg status . in repo root:" | |||
|
13 | hg status --color=always . | |||
|
14 | for dir in a b a/1 b/1 b/2; do | |||
|
15 | echo "hg status in $dir:" | |||
|
16 | hg status --color=always --cwd "$dir" | |||
|
17 | echo "hg status . in $dir:" | |||
|
18 | hg status --color=always --cwd "$dir" . | |||
|
19 | echo "hg status .. in $dir:" | |||
|
20 | hg status --color=always --cwd "$dir" .. | |||
|
21 | done | |||
|
22 | cd .. | |||
|
23 | ||||
|
24 | hg init repo2 | |||
|
25 | cd repo2 | |||
|
26 | touch modified removed deleted ignored | |||
|
27 | echo "^ignored$" > .hgignore | |||
|
28 | hg ci -A -m 'initial checkin' -d "1000000 0" | |||
|
29 | touch modified added unknown ignored | |||
|
30 | hg add added | |||
|
31 | hg remove removed | |||
|
32 | rm deleted | |||
|
33 | echo "hg status:" | |||
|
34 | hg status --color=always | |||
|
35 | echo "hg status modified added removed deleted unknown never-existed ignored:" | |||
|
36 | hg status --color=always modified added removed deleted unknown never-existed ignored | |||
|
37 | hg copy modified copied | |||
|
38 | echo "hg status -C:" | |||
|
39 | hg status --color=always -C | |||
|
40 | echo "hg status -A:" | |||
|
41 | hg status --color=always -A | |||
|
42 | echo "^ignoreddir$" > .hgignore | |||
|
43 | mkdir ignoreddir | |||
|
44 | touch ignoreddir/file | |||
|
45 | echo "hg status ignoreddir/file:" | |||
|
46 | hg status --color=always ignoreddir/file | |||
|
47 | echo "hg status -i ignoreddir/file:" | |||
|
48 | hg status --color=always -i ignoreddir/file | |||
|
49 | cd .. | |||
|
50 | ||||
|
51 | # check 'status -q' and some combinations | |||
|
52 | hg init repo3 | |||
|
53 | cd repo3 | |||
|
54 | touch modified removed deleted ignored | |||
|
55 | echo "^ignored$" > .hgignore | |||
|
56 | hg commit -A -m 'initial checkin' | |||
|
57 | touch added unknown ignored | |||
|
58 | hg add added | |||
|
59 | echo "test" >> modified | |||
|
60 | hg remove removed | |||
|
61 | rm deleted | |||
|
62 | hg copy modified copied | |||
|
63 | ||||
|
64 | # Run status with 2 different flags. | |||
|
65 | # Check if result is the same or different. | |||
|
66 | # If result is not as expected, raise error | |||
|
67 | assert() { | |||
|
68 | hg status --color=always $1 > ../a | |||
|
69 | hg status --color=always $2 > ../b | |||
|
70 | out=`diff ../a ../b` | |||
|
71 | if [ $? -ne 0 ]; then | |||
|
72 | out=1 | |||
|
73 | else | |||
|
74 | out=0 | |||
|
75 | fi | |||
|
76 | if [ $3 -eq 0 ]; then | |||
|
77 | df="same" | |||
|
78 | else | |||
|
79 | df="different" | |||
|
80 | fi | |||
|
81 | if [ $out -ne $3 ]; then | |||
|
82 | echo "Error on $1 and $2, should be $df." | |||
|
83 | fi | |||
|
84 | } | |||
|
85 | ||||
|
86 | # assert flag1 flag2 [0-same | 1-different] | |||
|
87 | assert "-q" "-mard" 0 | |||
|
88 | assert "-A" "-marduicC" 0 | |||
|
89 | assert "-qA" "-mardcC" 0 | |||
|
90 | assert "-qAui" "-A" 0 | |||
|
91 | assert "-qAu" "-marducC" 0 | |||
|
92 | assert "-qAi" "-mardicC" 0 | |||
|
93 | assert "-qu" "-u" 0 | |||
|
94 | assert "-q" "-u" 1 | |||
|
95 | assert "-m" "-a" 1 | |||
|
96 | assert "-r" "-d" 1 | |||
|
97 |
@@ -0,0 +1,126 b'' | |||||
|
1 | hg status in repo root: | |||
|
2 | [0;35;1;4m? a/1/in_a_1[39;22;24;0m | |||
|
3 | [0;35;1;4m? a/in_a[39;22;24;0m | |||
|
4 | [0;35;1;4m? b/1/in_b_1[39;22;24;0m | |||
|
5 | [0;35;1;4m? b/2/in_b_2[39;22;24;0m | |||
|
6 | [0;35;1;4m? b/in_b[39;22;24;0m | |||
|
7 | [0;35;1;4m? in_root[39;22;24;0m | |||
|
8 | hg status . in repo root: | |||
|
9 | [0;35;1;4m? a/1/in_a_1[39;22;24;0m | |||
|
10 | [0;35;1;4m? a/in_a[39;22;24;0m | |||
|
11 | [0;35;1;4m? b/1/in_b_1[39;22;24;0m | |||
|
12 | [0;35;1;4m? b/2/in_b_2[39;22;24;0m | |||
|
13 | [0;35;1;4m? b/in_b[39;22;24;0m | |||
|
14 | [0;35;1;4m? in_root[39;22;24;0m | |||
|
15 | hg status in a: | |||
|
16 | [0;35;1;4m? a/1/in_a_1[39;22;24;0m | |||
|
17 | [0;35;1;4m? a/in_a[39;22;24;0m | |||
|
18 | [0;35;1;4m? b/1/in_b_1[39;22;24;0m | |||
|
19 | [0;35;1;4m? b/2/in_b_2[39;22;24;0m | |||
|
20 | [0;35;1;4m? b/in_b[39;22;24;0m | |||
|
21 | [0;35;1;4m? in_root[39;22;24;0m | |||
|
22 | hg status . in a: | |||
|
23 | [0;35;1;4m? 1/in_a_1[39;22;24;0m | |||
|
24 | [0;35;1;4m? in_a[39;22;24;0m | |||
|
25 | hg status .. in a: | |||
|
26 | [0;35;1;4m? 1/in_a_1[39;22;24;0m | |||
|
27 | [0;35;1;4m? in_a[39;22;24;0m | |||
|
28 | [0;35;1;4m? ../b/1/in_b_1[39;22;24;0m | |||
|
29 | [0;35;1;4m? ../b/2/in_b_2[39;22;24;0m | |||
|
30 | [0;35;1;4m? ../b/in_b[39;22;24;0m | |||
|
31 | [0;35;1;4m? ../in_root[39;22;24;0m | |||
|
32 | hg status in b: | |||
|
33 | [0;35;1;4m? a/1/in_a_1[39;22;24;0m | |||
|
34 | [0;35;1;4m? a/in_a[39;22;24;0m | |||
|
35 | [0;35;1;4m? b/1/in_b_1[39;22;24;0m | |||
|
36 | [0;35;1;4m? b/2/in_b_2[39;22;24;0m | |||
|
37 | [0;35;1;4m? b/in_b[39;22;24;0m | |||
|
38 | [0;35;1;4m? in_root[39;22;24;0m | |||
|
39 | hg status . in b: | |||
|
40 | [0;35;1;4m? 1/in_b_1[39;22;24;0m | |||
|
41 | [0;35;1;4m? 2/in_b_2[39;22;24;0m | |||
|
42 | [0;35;1;4m? in_b[39;22;24;0m | |||
|
43 | hg status .. in b: | |||
|
44 | [0;35;1;4m? ../a/1/in_a_1[39;22;24;0m | |||
|
45 | [0;35;1;4m? ../a/in_a[39;22;24;0m | |||
|
46 | [0;35;1;4m? 1/in_b_1[39;22;24;0m | |||
|
47 | [0;35;1;4m? 2/in_b_2[39;22;24;0m | |||
|
48 | [0;35;1;4m? in_b[39;22;24;0m | |||
|
49 | [0;35;1;4m? ../in_root[39;22;24;0m | |||
|
50 | hg status in a/1: | |||
|
51 | [0;35;1;4m? a/1/in_a_1[39;22;24;0m | |||
|
52 | [0;35;1;4m? a/in_a[39;22;24;0m | |||
|
53 | [0;35;1;4m? b/1/in_b_1[39;22;24;0m | |||
|
54 | [0;35;1;4m? b/2/in_b_2[39;22;24;0m | |||
|
55 | [0;35;1;4m? b/in_b[39;22;24;0m | |||
|
56 | [0;35;1;4m? in_root[39;22;24;0m | |||
|
57 | hg status . in a/1: | |||
|
58 | [0;35;1;4m? in_a_1[39;22;24;0m | |||
|
59 | hg status .. in a/1: | |||
|
60 | [0;35;1;4m? in_a_1[39;22;24;0m | |||
|
61 | [0;35;1;4m? ../in_a[39;22;24;0m | |||
|
62 | hg status in b/1: | |||
|
63 | [0;35;1;4m? a/1/in_a_1[39;22;24;0m | |||
|
64 | [0;35;1;4m? a/in_a[39;22;24;0m | |||
|
65 | [0;35;1;4m? b/1/in_b_1[39;22;24;0m | |||
|
66 | [0;35;1;4m? b/2/in_b_2[39;22;24;0m | |||
|
67 | [0;35;1;4m? b/in_b[39;22;24;0m | |||
|
68 | [0;35;1;4m? in_root[39;22;24;0m | |||
|
69 | hg status . in b/1: | |||
|
70 | [0;35;1;4m? in_b_1[39;22;24;0m | |||
|
71 | hg status .. in b/1: | |||
|
72 | [0;35;1;4m? in_b_1[39;22;24;0m | |||
|
73 | [0;35;1;4m? ../2/in_b_2[39;22;24;0m | |||
|
74 | [0;35;1;4m? ../in_b[39;22;24;0m | |||
|
75 | hg status in b/2: | |||
|
76 | [0;35;1;4m? a/1/in_a_1[39;22;24;0m | |||
|
77 | [0;35;1;4m? a/in_a[39;22;24;0m | |||
|
78 | [0;35;1;4m? b/1/in_b_1[39;22;24;0m | |||
|
79 | [0;35;1;4m? b/2/in_b_2[39;22;24;0m | |||
|
80 | [0;35;1;4m? b/in_b[39;22;24;0m | |||
|
81 | [0;35;1;4m? in_root[39;22;24;0m | |||
|
82 | hg status . in b/2: | |||
|
83 | [0;35;1;4m? in_b_2[39;22;24;0m | |||
|
84 | hg status .. in b/2: | |||
|
85 | [0;35;1;4m? ../1/in_b_1[39;22;24;0m | |||
|
86 | [0;35;1;4m? in_b_2[39;22;24;0m | |||
|
87 | [0;35;1;4m? ../in_b[39;22;24;0m | |||
|
88 | adding .hgignore | |||
|
89 | adding deleted | |||
|
90 | adding modified | |||
|
91 | adding removed | |||
|
92 | hg status: | |||
|
93 | [0;32;1mA added[39;22;0m | |||
|
94 | [0;31;1mR removed[39;22;0m | |||
|
95 | [0;36;1;4m! deleted[39;22;24;0m | |||
|
96 | [0;35;1;4m? unknown[39;22;24;0m | |||
|
97 | hg status modified added removed deleted unknown never-existed ignored: | |||
|
98 | never-existed: No such file or directory | |||
|
99 | [0;32;1mA added[39;22;0m | |||
|
100 | [0;31;1mR removed[39;22;0m | |||
|
101 | [0;36;1;4m! deleted[39;22;24;0m | |||
|
102 | [0;35;1;4m? unknown[39;22;24;0m | |||
|
103 | hg status -C: | |||
|
104 | [0;32;1mA added[39;22;0m | |||
|
105 | [0;32;1mA copied[39;22;0m | |||
|
106 | [0;0m modified[0;0m | |||
|
107 | [0;31;1mR removed[39;22;0m | |||
|
108 | [0;36;1;4m! deleted[39;22;24;0m | |||
|
109 | [0;35;1;4m? unknown[39;22;24;0m | |||
|
110 | hg status -A: | |||
|
111 | [0;32;1mA added[39;22;0m | |||
|
112 | [0;32;1mA copied[39;22;0m | |||
|
113 | [0;0m modified[0;0m | |||
|
114 | [0;31;1mR removed[39;22;0m | |||
|
115 | [0;36;1;4m! deleted[39;22;24;0m | |||
|
116 | [0;35;1;4m? unknown[39;22;24;0m | |||
|
117 | [0;30;1mI ignored[39;22;0m | |||
|
118 | [0;0mC .hgignore[0;0m | |||
|
119 | [0;0mC modified[0;0m | |||
|
120 | hg status ignoreddir/file: | |||
|
121 | hg status -i ignoreddir/file: | |||
|
122 | [0;30;1mI ignoreddir/file[39;22;0m | |||
|
123 | adding .hgignore | |||
|
124 | adding deleted | |||
|
125 | adding modified | |||
|
126 | adding removed |
General Comments 0
You need to be logged in to leave comments.
Login now