Show More
@@ -1,102 +1,103 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | echo "bookmarks=" >> $HGRCPATH |
|
5 | 5 | |
|
6 | 6 | hg init |
|
7 | 7 | |
|
8 | 8 | echo % no bookmarks |
|
9 | 9 | hg bookmarks |
|
10 | 10 | |
|
11 | 11 | echo % bookmark rev -1 |
|
12 | 12 | hg bookmark X |
|
13 | 13 | |
|
14 | 14 | echo % list bookmarks |
|
15 | 15 | hg bookmarks |
|
16 | 16 | |
|
17 | 17 | echo % list bookmarks with color |
|
18 |
hg --config extensions.color= |
|
|
18 | hg --config extensions.color= --config color.mode=ansi \ | |
|
19 | bookmarks --color=always | |
|
19 | 20 | |
|
20 | 21 | echo a > a |
|
21 | 22 | hg add a |
|
22 | 23 | hg commit -m 0 |
|
23 | 24 | |
|
24 | 25 | echo % bookmark X moved to rev 0 |
|
25 | 26 | hg bookmarks |
|
26 | 27 | |
|
27 | 28 | echo % look up bookmark |
|
28 | 29 | hg log -r X |
|
29 | 30 | |
|
30 | 31 | echo % second bookmark for rev 0 |
|
31 | 32 | hg bookmark X2 |
|
32 | 33 | |
|
33 | 34 | echo % bookmark rev -1 again |
|
34 | 35 | hg bookmark -r null Y |
|
35 | 36 | |
|
36 | 37 | echo % list bookmarks |
|
37 | 38 | hg bookmarks |
|
38 | 39 | |
|
39 | 40 | echo b > b |
|
40 | 41 | hg add b |
|
41 | 42 | hg commit -m 1 |
|
42 | 43 | |
|
43 | 44 | echo % bookmarks X and X2 moved to rev 1, Y at rev -1 |
|
44 | 45 | hg bookmarks |
|
45 | 46 | |
|
46 | 47 | echo % bookmark rev 0 again |
|
47 | 48 | hg bookmark -r 0 Z |
|
48 | 49 | |
|
49 | 50 | echo c > c |
|
50 | 51 | hg add c |
|
51 | 52 | hg commit -m 2 |
|
52 | 53 | |
|
53 | 54 | echo % bookmarks X and X2 moved to rev 2, Y at rev -1, Z at rev 0 |
|
54 | 55 | hg bookmarks |
|
55 | 56 | |
|
56 | 57 | echo % rename nonexistent bookmark |
|
57 | 58 | hg bookmark -m A B |
|
58 | 59 | |
|
59 | 60 | echo % rename to existent bookmark |
|
60 | 61 | hg bookmark -m X Y |
|
61 | 62 | |
|
62 | 63 | echo % force rename to existent bookmark |
|
63 | 64 | hg bookmark -f -m X Y |
|
64 | 65 | |
|
65 | 66 | echo % list bookmarks |
|
66 | 67 | hg bookmark |
|
67 | 68 | |
|
68 | 69 | echo % rename without new name |
|
69 | 70 | hg bookmark -m Y |
|
70 | 71 | |
|
71 | 72 | echo % delete without name |
|
72 | 73 | hg bookmark -d |
|
73 | 74 | |
|
74 | 75 | echo % delete nonexistent bookmark |
|
75 | 76 | hg bookmark -d A |
|
76 | 77 | |
|
77 | 78 | echo % bookmark name with spaces should be stripped |
|
78 | 79 | hg bookmark ' x y ' |
|
79 | 80 | |
|
80 | 81 | echo % list bookmarks |
|
81 | 82 | hg bookmarks |
|
82 | 83 | |
|
83 | 84 | echo % look up stripped bookmark name |
|
84 | 85 | hg log -r 'x y' |
|
85 | 86 | |
|
86 | 87 | echo % reject bookmark name with newline |
|
87 | 88 | hg bookmark ' |
|
88 | 89 | ' |
|
89 | 90 | |
|
90 | 91 | echo % bookmark with existing name |
|
91 | 92 | hg bookmark Z |
|
92 | 93 | |
|
93 | 94 | echo % force bookmark with existing name |
|
94 | 95 | hg bookmark -f Z |
|
95 | 96 | |
|
96 | 97 | echo % list bookmarks |
|
97 | 98 | hg bookmark |
|
98 | 99 | |
|
99 | 100 | echo % revision but no bookmark name |
|
100 | 101 | hg bookmark -r . |
|
101 | 102 | |
|
102 | 103 | true |
@@ -1,58 +1,59 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | echo "bookmarks=" >> $HGRCPATH |
|
5 | 5 | |
|
6 | 6 | echo "[bookmarks]" >> $HGRCPATH |
|
7 | 7 | echo "track.current = True" >> $HGRCPATH |
|
8 | 8 | |
|
9 | 9 | hg init |
|
10 | 10 | |
|
11 | 11 | echo % no bookmarks |
|
12 | 12 | hg bookmarks |
|
13 | 13 | |
|
14 | 14 | echo % set bookmark X |
|
15 | 15 | hg bookmark X |
|
16 | 16 | |
|
17 | 17 | echo % list bookmarks |
|
18 | 18 | hg bookmark |
|
19 | 19 | |
|
20 | 20 | echo % list bookmarks with color |
|
21 |
hg --config extensions.color= |
|
|
21 | hg --config extensions.color= --config color.mode=ansi \ | |
|
22 | bookmark --color=always | |
|
22 | 23 | |
|
23 | 24 | echo % update to bookmark X |
|
24 | 25 | hg update X |
|
25 | 26 | |
|
26 | 27 | echo % list bookmarks |
|
27 | 28 | hg bookmarks |
|
28 | 29 | |
|
29 | 30 | echo % rename |
|
30 | 31 | hg bookmark -m X Z |
|
31 | 32 | |
|
32 | 33 | echo % list bookmarks |
|
33 | 34 | hg bookmarks |
|
34 | 35 | |
|
35 | 36 | echo % new bookmark Y |
|
36 | 37 | hg bookmark Y |
|
37 | 38 | |
|
38 | 39 | echo % list bookmarks |
|
39 | 40 | hg bookmark |
|
40 | 41 | |
|
41 | 42 | echo % commit |
|
42 | 43 | echo 'b' > b |
|
43 | 44 | hg add b |
|
44 | 45 | hg commit -m'test' |
|
45 | 46 | |
|
46 | 47 | echo % list bookmarks |
|
47 | 48 | hg bookmark |
|
48 | 49 | |
|
49 | 50 | echo % delete bookmarks |
|
50 | 51 | hg bookmark -d Y |
|
51 | 52 | hg bookmark -d Z |
|
52 | 53 | |
|
53 | 54 | echo % list bookmarks |
|
54 | 55 | hg bookmark |
|
55 | 56 | |
|
56 | 57 | echo % update to tip |
|
57 | 58 | hg update tip |
|
58 | 59 |
@@ -1,70 +1,71 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | echo "churn=" >> $HGRCPATH |
|
5 | 5 | |
|
6 | 6 | echo % create test repository |
|
7 | 7 | hg init repo |
|
8 | 8 | cd repo |
|
9 | 9 | echo a > a |
|
10 | 10 | hg ci -Am adda -u user1 -d 6:00 |
|
11 | 11 | echo b >> a |
|
12 | 12 | echo b > b |
|
13 | 13 | hg ci -m changeba -u user2 -d 9:00 a |
|
14 | 14 | hg ci -Am addb -u user2 -d 9:30 |
|
15 | 15 | echo c >> a |
|
16 | 16 | echo c >> b |
|
17 | 17 | echo c > c |
|
18 | 18 | hg ci -m changeca -u user3 -d 12:00 a |
|
19 | 19 | hg ci -m changecb -u user3 -d 12:15 b |
|
20 | 20 | hg ci -Am addc -u user3 -d 12:30 |
|
21 | 21 | mkdir -p d/e |
|
22 | 22 | echo abc > d/e/f1.txt |
|
23 | 23 | hg ci -Am "add d/e/f1.txt" -u user1 -d 12:45 d/e/f1.txt |
|
24 | 24 | mkdir -p d/g |
|
25 | 25 | echo def > d/g/f2.txt |
|
26 | 26 | hg ci -Am "add d/g/f2.txt" -u user1 -d 13:00 d/g/f2.txt |
|
27 | 27 | |
|
28 | 28 | echo % churn separate directories |
|
29 | 29 | cd d |
|
30 | 30 | hg churn e |
|
31 | 31 | echo % churn all |
|
32 | 32 | hg churn |
|
33 | 33 | echo % churn up to rev 2 |
|
34 | 34 | hg churn -r :2 |
|
35 | 35 | cd .. |
|
36 | 36 | echo % churn with aliases |
|
37 | 37 | cat > ../aliases <<EOF |
|
38 | 38 | user1 alias1 |
|
39 | 39 | user3 alias3 |
|
40 | 40 | EOF |
|
41 | 41 | hg churn --aliases ../aliases |
|
42 | 42 | echo % churn with .hgchurn |
|
43 | 43 | mv ../aliases .hgchurn |
|
44 | 44 | hg churn |
|
45 | 45 | rm .hgchurn |
|
46 | 46 | echo % churn with column specifier |
|
47 | 47 | COLUMNS=40 hg churn |
|
48 | 48 | echo % churn by hour |
|
49 | 49 | hg churn -f '%H' -s |
|
50 | 50 | |
|
51 | 51 | echo % churn with separated added/removed lines |
|
52 | 52 | hg rm d/g/f2.txt |
|
53 | 53 | hg ci -Am "removed d/g/f2.txt" -u user1 -d 14:00 d/g/f2.txt |
|
54 | 54 | hg churn --diffstat |
|
55 | 55 | echo % churn --diffstat with color |
|
56 |
hg --config extensions.color= churn -- |
|
|
56 | hg --config extensions.color= churn --config color.mode=ansi \ | |
|
57 | --diffstat --color=always | |
|
57 | 58 | |
|
58 | 59 | echo % changeset number churn |
|
59 | 60 | hg churn -c |
|
60 | 61 | |
|
61 | 62 | cd .. |
|
62 | 63 | |
|
63 | 64 | # issue 833: ZeroDivisionError |
|
64 | 65 | hg init issue-833 |
|
65 | 66 | cd issue-833 |
|
66 | 67 | touch foo |
|
67 | 68 | hg ci -Am foo |
|
68 | 69 | # this was failing with a ZeroDivisionError |
|
69 | 70 | hg churn |
|
70 | 71 | cd .. |
@@ -1,99 +1,100 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | mkdir t |
|
4 | 4 | cd t |
|
5 | 5 | hg init |
|
6 | 6 | echo import > port |
|
7 | 7 | hg add port |
|
8 | 8 | hg commit -m 0 -u spam -d '0 0' |
|
9 | 9 | echo export >> port |
|
10 | 10 | hg commit -m 1 -u eggs -d '1 0' |
|
11 | 11 | echo export > port |
|
12 | 12 | echo vaportight >> port |
|
13 | 13 | echo 'import/export' >> port |
|
14 | 14 | hg commit -m 2 -u spam -d '2 0' |
|
15 | 15 | echo 'import/export' >> port |
|
16 | 16 | hg commit -m 3 -u eggs -d '3 0' |
|
17 | 17 | head -n 3 port > port1 |
|
18 | 18 | mv port1 port |
|
19 | 19 | hg commit -m 4 -u spam -d '4 0' |
|
20 | 20 | echo % pattern error |
|
21 | 21 | hg grep '**test**' |
|
22 | 22 | echo % simple |
|
23 | 23 | hg grep port port |
|
24 | 24 | echo % simple with color |
|
25 |
hg --config extensions.color= grep --co |
|
|
25 | hg --config extensions.color= grep --config color.mode=ansi \ | |
|
26 | --color=always port port | |
|
26 | 27 | echo % all |
|
27 | 28 | hg grep --traceback --all -nu port port |
|
28 | 29 | echo % other |
|
29 | 30 | hg grep import port |
|
30 | 31 | |
|
31 | 32 | hg cp port port2 |
|
32 | 33 | hg commit -m 4 -u spam -d '5 0' |
|
33 | 34 | echo % follow |
|
34 | 35 | hg grep --traceback -f 'import$' port2 |
|
35 | 36 | echo deport >> port2 |
|
36 | 37 | hg commit -m 5 -u eggs -d '6 0' |
|
37 | 38 | hg grep -f --all -nu port port2 |
|
38 | 39 | |
|
39 | 40 | cd .. |
|
40 | 41 | hg init t2 |
|
41 | 42 | cd t2 |
|
42 | 43 | hg grep foobar foo |
|
43 | 44 | hg grep foobar |
|
44 | 45 | echo blue >> color |
|
45 | 46 | echo black >> color |
|
46 | 47 | hg add color |
|
47 | 48 | hg ci -m 0 |
|
48 | 49 | echo orange >> color |
|
49 | 50 | hg ci -m 1 |
|
50 | 51 | echo black > color |
|
51 | 52 | hg ci -m 2 |
|
52 | 53 | echo orange >> color |
|
53 | 54 | echo blue >> color |
|
54 | 55 | hg ci -m 3 |
|
55 | 56 | hg grep orange |
|
56 | 57 | hg grep --all orange |
|
57 | 58 | |
|
58 | 59 | echo % match in last "line" without newline |
|
59 | 60 | python -c 'fp = open("noeol", "wb"); fp.write("no infinite loop"); fp.close();' |
|
60 | 61 | hg ci -Amnoeol |
|
61 | 62 | echo % last character omitted in output to avoid infinite loop |
|
62 | 63 | hg grep loop |
|
63 | 64 | |
|
64 | 65 | # Got a traceback when using grep on a single |
|
65 | 66 | # revision with renamed files. |
|
66 | 67 | cd .. |
|
67 | 68 | echo % issue 685 |
|
68 | 69 | hg init issue685 |
|
69 | 70 | cd issue685 |
|
70 | 71 | echo octarine > color |
|
71 | 72 | hg ci -Amcolor |
|
72 | 73 | hg rename color colour |
|
73 | 74 | hg ci -Am rename |
|
74 | 75 | hg grep octarine |
|
75 | 76 | # Used to crash here |
|
76 | 77 | hg grep -r 1 octarine |
|
77 | 78 | |
|
78 | 79 | # Issue337: test that grep follows parent-child relationships instead |
|
79 | 80 | # of just using revision numbers. |
|
80 | 81 | cd .. |
|
81 | 82 | echo % issue 337 |
|
82 | 83 | hg init issue337 |
|
83 | 84 | cd issue337 |
|
84 | 85 | |
|
85 | 86 | echo white > color |
|
86 | 87 | hg commit -A -m "0 white" |
|
87 | 88 | |
|
88 | 89 | echo red > color |
|
89 | 90 | hg commit -A -m "1 red" |
|
90 | 91 | |
|
91 | 92 | hg update 0 |
|
92 | 93 | echo black > color |
|
93 | 94 | hg commit -A -m "2 black" |
|
94 | 95 | |
|
95 | 96 | hg update --clean 1 |
|
96 | 97 | echo blue > color |
|
97 | 98 | hg commit -A -m "3 blue" |
|
98 | 99 | |
|
99 | 100 | hg grep --all red |
@@ -1,183 +1,184 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | hg init a |
|
4 | 4 | |
|
5 | 5 | cd a |
|
6 | 6 | echo a > a |
|
7 | 7 | hg ci -Ama -d '1 0' |
|
8 | 8 | |
|
9 | 9 | hg cp a b |
|
10 | 10 | hg ci -mb -d '2 0' |
|
11 | 11 | |
|
12 | 12 | mkdir dir |
|
13 | 13 | hg mv b dir |
|
14 | 14 | hg ci -mc -d '3 0' |
|
15 | 15 | |
|
16 | 16 | hg mv a b |
|
17 | 17 | echo a > d |
|
18 | 18 | hg add d |
|
19 | 19 | hg ci -md -d '4 0' |
|
20 | 20 | |
|
21 | 21 | hg mv dir/b e |
|
22 | 22 | hg ci -me -d '5 0' |
|
23 | 23 | |
|
24 | 24 | hg log a |
|
25 | 25 | echo % -f, directory |
|
26 | 26 | hg log -f dir |
|
27 | 27 | echo % -f, but no args |
|
28 | 28 | hg log -f |
|
29 | 29 | echo % one rename |
|
30 | 30 | hg log -vf a |
|
31 | 31 | echo % many renames |
|
32 | 32 | hg log -vf e |
|
33 | 33 | |
|
34 | 34 | echo '% log copies with --copies' |
|
35 | 35 | hg log -vC --template '{rev} {file_copies}\n' |
|
36 | 36 | echo '% log copies switch without --copies, with old filecopy template' |
|
37 | 37 | hg log -v --template '{rev} {file_copies_switch%filecopy}\n' |
|
38 | 38 | echo '% log copies switch with --copies' |
|
39 | 39 | hg log -vC --template '{rev} {file_copies_switch}\n' |
|
40 | 40 | |
|
41 | 41 | echo '% log copies with hardcoded style and with --style=default' |
|
42 | 42 | hg log -vC -r4 |
|
43 | 43 | hg log -vC -r4 --style=default |
|
44 | 44 | |
|
45 | 45 | echo % log copies, non-linear manifest |
|
46 | 46 | hg up -C 3 |
|
47 | 47 | hg mv dir/b e |
|
48 | 48 | echo foo > foo |
|
49 | 49 | hg ci -Ame2 -d '6 0' |
|
50 | 50 | hg log -v --template '{rev} {file_copies}\n' -r 5 |
|
51 | 51 | |
|
52 | 52 | echo % log copies, execute bit set |
|
53 | 53 | chmod +x e |
|
54 | 54 | hg ci -me3 -d '7 0' |
|
55 | 55 | hg log -v --template '{rev} {file_copies}\n' -r 6 |
|
56 | 56 | |
|
57 | 57 | echo '% log -p d' |
|
58 | 58 | hg log -pv d |
|
59 | 59 | |
|
60 | 60 | # log --follow tests |
|
61 | 61 | hg init ../follow |
|
62 | 62 | cd ../follow |
|
63 | 63 | |
|
64 | 64 | echo base > base |
|
65 | 65 | hg ci -Ambase -d '1 0' |
|
66 | 66 | |
|
67 | 67 | echo r1 >> base |
|
68 | 68 | hg ci -Amr1 -d '1 0' |
|
69 | 69 | echo r2 >> base |
|
70 | 70 | hg ci -Amr2 -d '1 0' |
|
71 | 71 | |
|
72 | 72 | hg up -C 1 |
|
73 | 73 | echo b1 > b1 |
|
74 | 74 | hg ci -Amb1 -d '1 0' |
|
75 | 75 | |
|
76 | 76 | echo % log -f |
|
77 | 77 | hg log -f |
|
78 | 78 | |
|
79 | 79 | hg up -C 0 |
|
80 | 80 | echo b2 > b2 |
|
81 | 81 | hg ci -Amb2 -d '1 0' |
|
82 | 82 | |
|
83 | 83 | echo % log -f -r 1:tip |
|
84 | 84 | hg log -f -r 1:tip |
|
85 | 85 | |
|
86 | 86 | hg up -C 3 |
|
87 | 87 | hg merge tip |
|
88 | 88 | |
|
89 | 89 | echo % log -r . with two parents |
|
90 | 90 | hg log -r . |
|
91 | 91 | |
|
92 | 92 | hg ci -mm12 -d '1 0' |
|
93 | 93 | |
|
94 | 94 | echo % log -r . with one parent |
|
95 | 95 | hg log -r . |
|
96 | 96 | |
|
97 | 97 | echo postm >> b1 |
|
98 | 98 | hg ci -Amb1.1 -d'1 0' |
|
99 | 99 | |
|
100 | 100 | echo % log --follow-first |
|
101 | 101 | hg log --follow-first |
|
102 | 102 | |
|
103 | 103 | echo % log -P 2 |
|
104 | 104 | hg log -P 2 |
|
105 | 105 | |
|
106 | 106 | echo '% log -r tip -p --git' |
|
107 | 107 | hg log -r tip -p --git |
|
108 | 108 | |
|
109 | 109 | echo '% log -r ""' |
|
110 | 110 | hg log -r '' |
|
111 | 111 | |
|
112 | 112 | echo '% log -r <some unknown node id>' |
|
113 | 113 | hg log -r 1000000000000000000000000000000000000000 |
|
114 | 114 | |
|
115 | 115 | echo '% log -k r1' |
|
116 | 116 | hg log -k r1 |
|
117 | 117 | |
|
118 | 118 | echo '% log -d -1' |
|
119 | 119 | hg log -d -1 |
|
120 | 120 | |
|
121 | 121 | echo '% log -p -l2 --color=always' |
|
122 |
hg --config extensions.color= |
|
|
122 | hg --config extensions.color= --config color.mode=ansi \ | |
|
123 | log -p -l2 --color=always | |
|
123 | 124 | |
|
124 | 125 | echo '% log -r tip --stat' |
|
125 | 126 | hg log -r tip --stat |
|
126 | 127 | |
|
127 | 128 | cd .. |
|
128 | 129 | |
|
129 | 130 | hg init usertest |
|
130 | 131 | cd usertest |
|
131 | 132 | |
|
132 | 133 | echo a > a |
|
133 | 134 | hg ci -A -m "a" -u "User One <user1@example.org>" |
|
134 | 135 | echo b > b |
|
135 | 136 | hg ci -A -m "b" -u "User Two <user2@example.org>" |
|
136 | 137 | |
|
137 | 138 | hg log -u "User One <user1@example.org>" |
|
138 | 139 | hg log -u "user1" -u "user2" |
|
139 | 140 | hg log -u "user3" |
|
140 | 141 | |
|
141 | 142 | cd .. |
|
142 | 143 | |
|
143 | 144 | hg init branches |
|
144 | 145 | cd branches |
|
145 | 146 | |
|
146 | 147 | echo a > a |
|
147 | 148 | hg ci -A -m "commit on default" |
|
148 | 149 | hg branch test |
|
149 | 150 | echo b > b |
|
150 | 151 | hg ci -A -m "commit on test" |
|
151 | 152 | |
|
152 | 153 | hg up default |
|
153 | 154 | echo c > c |
|
154 | 155 | hg ci -A -m "commit on default" |
|
155 | 156 | hg up test |
|
156 | 157 | echo c > c |
|
157 | 158 | hg ci -A -m "commit on test" |
|
158 | 159 | |
|
159 | 160 | echo '% log -b default' |
|
160 | 161 | hg log -b default |
|
161 | 162 | |
|
162 | 163 | echo '% log -b test' |
|
163 | 164 | hg log -b test |
|
164 | 165 | |
|
165 | 166 | echo '% log -b dummy' |
|
166 | 167 | hg log -b dummy |
|
167 | 168 | |
|
168 | 169 | echo '% log -b .' |
|
169 | 170 | hg log -b . |
|
170 | 171 | |
|
171 | 172 | echo '% log -b default -b test' |
|
172 | 173 | hg log -b default -b test |
|
173 | 174 | |
|
174 | 175 | echo '% log -b default -b .' |
|
175 | 176 | hg log -b default -b . |
|
176 | 177 | |
|
177 | 178 | echo '% log -b . -b test' |
|
178 | 179 | hg log -b . -b test |
|
179 | 180 | |
|
180 | 181 | echo '% log -b 2' |
|
181 | 182 | hg log -b 2 |
|
182 | 183 | |
|
183 | 184 | exit 0 |
@@ -1,167 +1,168 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | echo "mq=" >> $HGRCPATH |
|
5 | 5 | |
|
6 | 6 | hg init |
|
7 | 7 | hg qinit |
|
8 | 8 | |
|
9 | 9 | echo x > x |
|
10 | 10 | hg ci -Ama |
|
11 | 11 | |
|
12 | 12 | hg qnew a.patch |
|
13 | 13 | echo a > a |
|
14 | 14 | hg add a |
|
15 | 15 | hg qrefresh |
|
16 | 16 | |
|
17 | 17 | hg qnew b.patch |
|
18 | 18 | echo b > b |
|
19 | 19 | hg add b |
|
20 | 20 | hg qrefresh |
|
21 | 21 | |
|
22 | 22 | hg qnew c.patch |
|
23 | 23 | echo c > c |
|
24 | 24 | hg add c |
|
25 | 25 | hg qrefresh |
|
26 | 26 | |
|
27 | 27 | hg qpop -a |
|
28 | 28 | |
|
29 | 29 | echo % should fail |
|
30 | 30 | hg qguard does-not-exist.patch +bleh |
|
31 | 31 | |
|
32 | 32 | echo % should fail |
|
33 | 33 | hg qguard +fail |
|
34 | 34 | |
|
35 | 35 | hg qpush |
|
36 | 36 | echo % should guard a.patch |
|
37 | 37 | hg qguard +a |
|
38 | 38 | echo % should print +a |
|
39 | 39 | hg qguard |
|
40 | 40 | hg qpop |
|
41 | 41 | |
|
42 | 42 | echo % should fail |
|
43 | 43 | hg qpush a.patch |
|
44 | 44 | |
|
45 | 45 | hg qguard a.patch |
|
46 | 46 | echo % should push b.patch |
|
47 | 47 | hg qpush |
|
48 | 48 | |
|
49 | 49 | hg qpop |
|
50 | 50 | echo % test selection of an empty guard |
|
51 | 51 | hg qselect "" |
|
52 | 52 | hg qselect a |
|
53 | 53 | echo % should push a.patch |
|
54 | 54 | hg qpush |
|
55 | 55 | |
|
56 | 56 | hg qguard -- c.patch -a |
|
57 | 57 | echo % should print -a |
|
58 | 58 | hg qguard c.patch |
|
59 | 59 | |
|
60 | 60 | echo % should skip c.patch |
|
61 | 61 | hg qpush -a |
|
62 | 62 | echo % should display b.patch |
|
63 | 63 | hg qtop |
|
64 | 64 | |
|
65 | 65 | hg qguard -n c.patch |
|
66 | 66 | echo % should push c.patch |
|
67 | 67 | hg qpush -a |
|
68 | 68 | |
|
69 | 69 | hg qpop -a |
|
70 | 70 | hg qselect -n |
|
71 | 71 | echo % should push all |
|
72 | 72 | hg qpush -a |
|
73 | 73 | |
|
74 | 74 | hg qpop -a |
|
75 | 75 | hg qguard a.patch +1 |
|
76 | 76 | hg qguard b.patch +2 |
|
77 | 77 | hg qselect 1 |
|
78 | 78 | echo % should push a.patch, not b.patch |
|
79 | 79 | hg qpush |
|
80 | 80 | hg qpush |
|
81 | 81 | hg qpop -a |
|
82 | 82 | |
|
83 | 83 | hg qselect 2 |
|
84 | 84 | echo % should push b.patch |
|
85 | 85 | hg qpush |
|
86 | 86 | hg qpush -a |
|
87 | 87 | # Used to be an issue with holes in the patch sequence |
|
88 | 88 | # So, put one hole on the base and ask for topmost patch. |
|
89 | 89 | hg qtop |
|
90 | 90 | hg qpop -a |
|
91 | 91 | |
|
92 | 92 | hg qselect 1 2 |
|
93 | 93 | echo % should push a.patch, b.patch |
|
94 | 94 | hg qpush |
|
95 | 95 | hg qpush |
|
96 | 96 | hg qpop -a |
|
97 | 97 | |
|
98 | 98 | hg qguard -- a.patch +1 +2 -3 |
|
99 | 99 | hg qselect 1 2 3 |
|
100 | 100 | echo % list patches and guards |
|
101 | 101 | hg qguard -l |
|
102 | 102 | echo % list patches and guards with color |
|
103 |
hg --config extensions.color= qguard - |
|
|
103 | hg --config extensions.color= qguard --config color.mode=ansi \ | |
|
104 | -l --color=always | |
|
104 | 105 | echo % list series |
|
105 | 106 | hg qseries -v |
|
106 | 107 | echo % list guards |
|
107 | 108 | hg qselect |
|
108 | 109 | echo % should push b.patch |
|
109 | 110 | hg qpush |
|
110 | 111 | |
|
111 | 112 | hg qpush -a |
|
112 | 113 | hg qselect -n --reapply |
|
113 | 114 | echo % guards in series file: +1 +2 -3 |
|
114 | 115 | hg qselect -s |
|
115 | 116 | echo % should show c.patch |
|
116 | 117 | hg qapplied |
|
117 | 118 | |
|
118 | 119 | hg qrename a.patch new.patch |
|
119 | 120 | echo % should show : |
|
120 | 121 | echo % new.patch: +1 +2 -3 |
|
121 | 122 | echo % b.patch: +2 |
|
122 | 123 | echo % c.patch: unguarded |
|
123 | 124 | hg qguard -l |
|
124 | 125 | |
|
125 | 126 | hg qnew d.patch |
|
126 | 127 | hg qpop |
|
127 | 128 | echo % should show new.patch and b.patch as Guarded, c.patch as Applied |
|
128 | 129 | echo % and d.patch as Unapplied |
|
129 | 130 | hg qseries -v |
|
130 | 131 | echo % qseries again, but with color |
|
131 | 132 | hg --config extensions.color= qseries -v --color=always |
|
132 | 133 | |
|
133 | 134 | hg qguard d.patch +2 |
|
134 | 135 | echo % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded. |
|
135 | 136 | hg qseries -v |
|
136 | 137 | |
|
137 | 138 | qappunappv() |
|
138 | 139 | { |
|
139 | 140 | for command in qapplied "qapplied -v" qunapplied "qunapplied -v"; do |
|
140 | 141 | echo % hg $command |
|
141 | 142 | hg $command |
|
142 | 143 | done |
|
143 | 144 | } |
|
144 | 145 | |
|
145 | 146 | hg qpop -a |
|
146 | 147 | hg qguard -l |
|
147 | 148 | qappunappv |
|
148 | 149 | hg qselect 1 |
|
149 | 150 | qappunappv |
|
150 | 151 | hg qpush -a |
|
151 | 152 | qappunappv |
|
152 | 153 | hg qselect 2 |
|
153 | 154 | qappunappv |
|
154 | 155 | |
|
155 | 156 | for patch in `hg qseries`; do |
|
156 | 157 | echo % hg qapplied $patch |
|
157 | 158 | hg qapplied $patch |
|
158 | 159 | echo % hg qunapplied $patch |
|
159 | 160 | hg qunapplied $patch |
|
160 | 161 | done |
|
161 | 162 | |
|
162 | 163 | echo % hg qseries -m: only b.patch should be shown |
|
163 | 164 | echo the guards file was not ignored in the past |
|
164 | 165 | hg qdelete -k b.patch |
|
165 | 166 | hg qseries -m |
|
166 | 167 | echo % hg qseries -m with color |
|
167 | 168 | hg --config extensions.color= qseries -m --color=always |
@@ -1,120 +1,122 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | echo "color=" >> $HGRCPATH |
|
5 | echo "[color]" >> $HGRCPATH | |
|
6 | echo "mode=ansi" >> $HGRCPATH | |
|
5 | 7 | |
|
6 | 8 | hg init repo1 |
|
7 | 9 | cd repo1 |
|
8 | 10 | mkdir a b a/1 b/1 b/2 |
|
9 | 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 |
|
10 | 12 | echo "hg status in repo root:" |
|
11 | 13 | hg status --color=always |
|
12 | 14 | echo "hg status . in repo root:" |
|
13 | 15 | hg status --color=always . |
|
14 | 16 | for dir in a b a/1 b/1 b/2; do |
|
15 | 17 | echo "hg status in $dir:" |
|
16 | 18 | hg status --color=always --cwd "$dir" |
|
17 | 19 | echo "hg status . in $dir:" |
|
18 | 20 | hg status --color=always --cwd "$dir" . |
|
19 | 21 | echo "hg status .. in $dir:" |
|
20 | 22 | hg status --color=always --cwd "$dir" .. |
|
21 | 23 | done |
|
22 | 24 | cd .. |
|
23 | 25 | |
|
24 | 26 | hg init repo2 |
|
25 | 27 | cd repo2 |
|
26 | 28 | touch modified removed deleted ignored |
|
27 | 29 | echo "^ignored$" > .hgignore |
|
28 | 30 | hg ci -A -m 'initial checkin' -d "1000000 0" |
|
29 | 31 | touch modified added unknown ignored |
|
30 | 32 | hg add added |
|
31 | 33 | hg remove removed |
|
32 | 34 | rm deleted |
|
33 | 35 | echo "hg status:" |
|
34 | 36 | hg status --color=always |
|
35 | 37 | echo "hg status modified added removed deleted unknown never-existed ignored:" |
|
36 | 38 | hg status --color=always modified added removed deleted unknown never-existed ignored |
|
37 | 39 | hg copy modified copied |
|
38 | 40 | echo "hg status -C:" |
|
39 | 41 | hg status --color=always -C |
|
40 | 42 | echo "hg status -A:" |
|
41 | 43 | hg status --color=always -A |
|
42 | 44 | echo "^ignoreddir$" > .hgignore |
|
43 | 45 | mkdir ignoreddir |
|
44 | 46 | touch ignoreddir/file |
|
45 | 47 | echo "hg status ignoreddir/file:" |
|
46 | 48 | hg status --color=always ignoreddir/file |
|
47 | 49 | echo "hg status -i ignoreddir/file:" |
|
48 | 50 | hg status --color=always -i ignoreddir/file |
|
49 | 51 | cd .. |
|
50 | 52 | |
|
51 | 53 | # check 'status -q' and some combinations |
|
52 | 54 | hg init repo3 |
|
53 | 55 | cd repo3 |
|
54 | 56 | touch modified removed deleted ignored |
|
55 | 57 | echo "^ignored$" > .hgignore |
|
56 | 58 | hg commit -A -m 'initial checkin' |
|
57 | 59 | touch added unknown ignored |
|
58 | 60 | hg add added |
|
59 | 61 | echo "test" >> modified |
|
60 | 62 | hg remove removed |
|
61 | 63 | rm deleted |
|
62 | 64 | hg copy modified copied |
|
63 | 65 | |
|
64 | 66 | echo "% test unknown color" |
|
65 | 67 | hg --config color.status.modified=periwinkle status --color=always |
|
66 | 68 | |
|
67 | 69 | # Run status with 2 different flags. |
|
68 | 70 | # Check if result is the same or different. |
|
69 | 71 | # If result is not as expected, raise error |
|
70 | 72 | assert() { |
|
71 | 73 | hg status --color=always $1 > ../a |
|
72 | 74 | hg status --color=always $2 > ../b |
|
73 | 75 | out=`diff ../a ../b` |
|
74 | 76 | if [ $? -ne 0 ]; then |
|
75 | 77 | out=1 |
|
76 | 78 | else |
|
77 | 79 | out=0 |
|
78 | 80 | fi |
|
79 | 81 | if [ $3 -eq 0 ]; then |
|
80 | 82 | df="same" |
|
81 | 83 | else |
|
82 | 84 | df="different" |
|
83 | 85 | fi |
|
84 | 86 | if [ $out -ne $3 ]; then |
|
85 | 87 | echo "Error on $1 and $2, should be $df." |
|
86 | 88 | fi |
|
87 | 89 | } |
|
88 | 90 | |
|
89 | 91 | # assert flag1 flag2 [0-same | 1-different] |
|
90 | 92 | assert "-q" "-mard" 0 |
|
91 | 93 | assert "-A" "-marduicC" 0 |
|
92 | 94 | assert "-qA" "-mardcC" 0 |
|
93 | 95 | assert "-qAui" "-A" 0 |
|
94 | 96 | assert "-qAu" "-marducC" 0 |
|
95 | 97 | assert "-qAi" "-mardicC" 0 |
|
96 | 98 | assert "-qu" "-u" 0 |
|
97 | 99 | assert "-q" "-u" 1 |
|
98 | 100 | assert "-m" "-a" 1 |
|
99 | 101 | assert "-r" "-d" 1 |
|
100 | 102 | |
|
101 | 103 | cd .. |
|
102 | 104 | |
|
103 | 105 | # test 'resolve -l' |
|
104 | 106 | hg init repo4 |
|
105 | 107 | cd repo4 |
|
106 | 108 | echo "file a" > a |
|
107 | 109 | echo "file b" > b |
|
108 | 110 | hg add a b |
|
109 | 111 | hg commit -m "initial" |
|
110 | 112 | echo "file a change 1" > a |
|
111 | 113 | echo "file b change 1" > b |
|
112 | 114 | hg commit -m "head 1" |
|
113 | 115 | hg update 0 |
|
114 | 116 | echo "file a change 2" > a |
|
115 | 117 | echo "file b change 2" > b |
|
116 | 118 | hg commit -m "head 2" |
|
117 | 119 | hg merge |
|
118 | 120 | hg resolve -m b |
|
119 | 121 | echo "hg resolve with one unresolved, one resolved:" |
|
120 | 122 | hg resolve --color=always -l |
General Comments 0
You need to be logged in to leave comments.
Login now