Show More
@@ -1,150 +1,154 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | echo "[extensions]" >> $HGRCPATH |
|
3 | echo "[extensions]" >> $HGRCPATH | |
4 | echo "mq=" >> $HGRCPATH |
|
4 | echo "mq=" >> $HGRCPATH | |
5 |
|
5 | |||
6 | hg init |
|
6 | hg init | |
7 | hg qinit |
|
7 | hg qinit | |
8 |
|
8 | |||
9 | echo x > x |
|
9 | echo x > x | |
10 | hg ci -Ama |
|
10 | hg ci -Ama | |
11 |
|
11 | |||
12 | hg qnew a.patch |
|
12 | hg qnew a.patch | |
13 | echo a > a |
|
13 | echo a > a | |
14 | hg add a |
|
14 | hg add a | |
15 | hg qrefresh |
|
15 | hg qrefresh | |
16 |
|
16 | |||
17 | hg qnew b.patch |
|
17 | hg qnew b.patch | |
18 | echo b > b |
|
18 | echo b > b | |
19 | hg add b |
|
19 | hg add b | |
20 | hg qrefresh |
|
20 | hg qrefresh | |
21 |
|
21 | |||
22 | hg qnew c.patch |
|
22 | hg qnew c.patch | |
23 | echo c > c |
|
23 | echo c > c | |
24 | hg add c |
|
24 | hg add c | |
25 | hg qrefresh |
|
25 | hg qrefresh | |
26 |
|
26 | |||
27 | hg qpop -a |
|
27 | hg qpop -a | |
28 |
|
28 | |||
29 | echo % should fail |
|
29 | echo % should fail | |
30 | hg qguard does-not-exist.patch +bleh |
|
30 | hg qguard does-not-exist.patch +bleh | |
31 |
|
31 | |||
32 | echo % should fail |
|
32 | echo % should fail | |
33 | hg qguard +fail |
|
33 | hg qguard +fail | |
34 |
|
34 | |||
35 | hg qpush |
|
35 | hg qpush | |
36 | echo % should guard a.patch |
|
36 | echo % should guard a.patch | |
37 | hg qguard +a |
|
37 | hg qguard +a | |
38 | echo % should print +a |
|
38 | echo % should print +a | |
39 | hg qguard |
|
39 | hg qguard | |
40 | hg qpop |
|
40 | hg qpop | |
41 |
|
41 | |||
42 | hg qguard a.patch |
|
42 | hg qguard a.patch | |
43 | echo % should push b.patch |
|
43 | echo % should push b.patch | |
44 | hg qpush |
|
44 | hg qpush | |
45 |
|
45 | |||
46 | hg qpop |
|
46 | hg qpop | |
47 | hg qselect a |
|
47 | hg qselect a | |
48 | echo % should push a.patch |
|
48 | echo % should push a.patch | |
49 | hg qpush |
|
49 | hg qpush | |
50 |
|
50 | |||
51 | hg qguard c.patch -a |
|
51 | hg qguard c.patch -a | |
52 | echo % should print -a |
|
52 | echo % should print -a | |
53 | hg qguard c.patch |
|
53 | hg qguard c.patch | |
54 |
|
54 | |||
55 | echo % should skip c.patch |
|
55 | echo % should skip c.patch | |
56 | hg qpush -a |
|
56 | hg qpush -a | |
57 |
|
57 | |||
58 | hg qguard -n c.patch |
|
58 | hg qguard -n c.patch | |
59 | echo % should push c.patch |
|
59 | echo % should push c.patch | |
60 | hg qpush -a |
|
60 | hg qpush -a | |
61 |
|
61 | |||
62 | hg qpop -a |
|
62 | hg qpop -a | |
63 | hg qselect -n |
|
63 | hg qselect -n | |
64 | echo % should push all |
|
64 | echo % should push all | |
65 | hg qpush -a |
|
65 | hg qpush -a | |
66 |
|
66 | |||
67 | hg qpop -a |
|
67 | hg qpop -a | |
68 | hg qguard a.patch +1 |
|
68 | hg qguard a.patch +1 | |
69 | hg qguard b.patch +2 |
|
69 | hg qguard b.patch +2 | |
70 | hg qselect 1 |
|
70 | hg qselect 1 | |
71 | echo % should push a.patch, not b.patch |
|
71 | echo % should push a.patch, not b.patch | |
72 | hg qpush |
|
72 | hg qpush | |
73 | hg qpush |
|
73 | hg qpush | |
74 | hg qpop -a |
|
74 | hg qpop -a | |
75 |
|
75 | |||
76 | hg qselect 2 |
|
76 | hg qselect 2 | |
77 | echo % should push b.patch |
|
77 | echo % should push b.patch | |
78 | hg qpush |
|
78 | hg qpush | |
|
79 | hg qpush -a | |||
|
80 | # Used to be an issue with holes in the patch sequence | |||
|
81 | # So, put one hole on the base and ask for topmost patch. | |||
|
82 | hg qtop | |||
79 | hg qpop -a |
|
83 | hg qpop -a | |
80 |
|
84 | |||
81 | hg qselect 1 2 |
|
85 | hg qselect 1 2 | |
82 | echo % should push a.patch, b.patch |
|
86 | echo % should push a.patch, b.patch | |
83 | hg qpush |
|
87 | hg qpush | |
84 | hg qpush |
|
88 | hg qpush | |
85 | hg qpop -a |
|
89 | hg qpop -a | |
86 |
|
90 | |||
87 | hg qguard a.patch +1 +2 -3 |
|
91 | hg qguard a.patch +1 +2 -3 | |
88 | hg qselect 1 2 3 |
|
92 | hg qselect 1 2 3 | |
89 | echo % list patches and guards |
|
93 | echo % list patches and guards | |
90 | hg qguard -l |
|
94 | hg qguard -l | |
91 | echo % list series |
|
95 | echo % list series | |
92 | hg qseries -v |
|
96 | hg qseries -v | |
93 | echo % list guards |
|
97 | echo % list guards | |
94 | hg qselect |
|
98 | hg qselect | |
95 | echo % should push b.patch |
|
99 | echo % should push b.patch | |
96 | hg qpush |
|
100 | hg qpush | |
97 |
|
101 | |||
98 | hg qpush -a |
|
102 | hg qpush -a | |
99 | hg qselect -n --reapply |
|
103 | hg qselect -n --reapply | |
100 | echo % guards in series file: +1 +2 -3 |
|
104 | echo % guards in series file: +1 +2 -3 | |
101 | hg qselect -s |
|
105 | hg qselect -s | |
102 | echo % should show c.patch |
|
106 | echo % should show c.patch | |
103 | hg qapplied |
|
107 | hg qapplied | |
104 |
|
108 | |||
105 | hg qrename a.patch new.patch |
|
109 | hg qrename a.patch new.patch | |
106 | echo % should show : |
|
110 | echo % should show : | |
107 | echo % new.patch: +1 +2 -3 |
|
111 | echo % new.patch: +1 +2 -3 | |
108 | echo % b.patch: +2 |
|
112 | echo % b.patch: +2 | |
109 | echo % c.patch: unguarded |
|
113 | echo % c.patch: unguarded | |
110 | hg qguard -l |
|
114 | hg qguard -l | |
111 |
|
115 | |||
112 | hg qnew d.patch |
|
116 | hg qnew d.patch | |
113 | hg qpop |
|
117 | hg qpop | |
114 | echo % should show new.patch and b.patch as Guarded, c.patch as Applied |
|
118 | echo % should show new.patch and b.patch as Guarded, c.patch as Applied | |
115 | echo % and d.patch as Unapplied |
|
119 | echo % and d.patch as Unapplied | |
116 | hg qseries -v |
|
120 | hg qseries -v | |
117 |
|
121 | |||
118 | hg qguard d.patch +2 |
|
122 | hg qguard d.patch +2 | |
119 | echo % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded. |
|
123 | echo % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded. | |
120 | hg qseries -v |
|
124 | hg qseries -v | |
121 |
|
125 | |||
122 | qappunappv() |
|
126 | qappunappv() | |
123 | ( |
|
127 | ( | |
124 | for command in qapplied "qapplied -v" qunapplied "qunapplied -v"; do |
|
128 | for command in qapplied "qapplied -v" qunapplied "qunapplied -v"; do | |
125 | echo % hg $command |
|
129 | echo % hg $command | |
126 | hg $command |
|
130 | hg $command | |
127 | done |
|
131 | done | |
128 | ) |
|
132 | ) | |
129 |
|
133 | |||
130 | hg qpop -a |
|
134 | hg qpop -a | |
131 | hg qguard -l |
|
135 | hg qguard -l | |
132 | qappunappv |
|
136 | qappunappv | |
133 | hg qselect 1 |
|
137 | hg qselect 1 | |
134 | qappunappv |
|
138 | qappunappv | |
135 | hg qpush -a |
|
139 | hg qpush -a | |
136 | qappunappv |
|
140 | qappunappv | |
137 | hg qselect 2 |
|
141 | hg qselect 2 | |
138 | qappunappv |
|
142 | qappunappv | |
139 |
|
143 | |||
140 | for patch in `hg qseries`; do |
|
144 | for patch in `hg qseries`; do | |
141 | echo % hg qapplied $patch |
|
145 | echo % hg qapplied $patch | |
142 | hg qapplied $patch |
|
146 | hg qapplied $patch | |
143 | echo % hg qunapplied $patch |
|
147 | echo % hg qunapplied $patch | |
144 | hg qunapplied $patch |
|
148 | hg qunapplied $patch | |
145 | done |
|
149 | done | |
146 |
|
150 | |||
147 | echo % hg qseries -m: only b.patch should be shown |
|
151 | echo % hg qseries -m: only b.patch should be shown | |
148 | echo the guards file was not ignored in the past |
|
152 | echo the guards file was not ignored in the past | |
149 | hg qdelete -k b.patch |
|
153 | hg qdelete -k b.patch | |
150 | hg qseries -m |
|
154 | hg qseries -m |
@@ -1,179 +1,182 b'' | |||||
1 | adding x |
|
1 | adding x | |
2 | Patch queue now empty |
|
2 | Patch queue now empty | |
3 | % should fail |
|
3 | % should fail | |
4 | abort: no patch named does-not-exist.patch |
|
4 | abort: no patch named does-not-exist.patch | |
5 | % should fail |
|
5 | % should fail | |
6 | abort: no patches applied |
|
6 | abort: no patches applied | |
7 | applying a.patch |
|
7 | applying a.patch | |
8 | Now at: a.patch |
|
8 | Now at: a.patch | |
9 | % should guard a.patch |
|
9 | % should guard a.patch | |
10 | % should print +a |
|
10 | % should print +a | |
11 | a.patch: +a |
|
11 | a.patch: +a | |
12 | Patch queue now empty |
|
12 | Patch queue now empty | |
13 | a.patch: +a |
|
13 | a.patch: +a | |
14 | % should push b.patch |
|
14 | % should push b.patch | |
15 | applying b.patch |
|
15 | applying b.patch | |
16 | Now at: b.patch |
|
16 | Now at: b.patch | |
17 | Patch queue now empty |
|
17 | Patch queue now empty | |
18 | number of unguarded, unapplied patches has changed from 2 to 3 |
|
18 | number of unguarded, unapplied patches has changed from 2 to 3 | |
19 | % should push a.patch |
|
19 | % should push a.patch | |
20 | applying a.patch |
|
20 | applying a.patch | |
21 | Now at: a.patch |
|
21 | Now at: a.patch | |
22 | % should print -a |
|
22 | % should print -a | |
23 | c.patch: -a |
|
23 | c.patch: -a | |
24 | % should skip c.patch |
|
24 | % should skip c.patch | |
25 | applying b.patch |
|
25 | applying b.patch | |
26 | skipping c.patch - guarded by '-a' |
|
26 | skipping c.patch - guarded by '-a' | |
27 | Now at: b.patch |
|
27 | Now at: b.patch | |
28 | % should push c.patch |
|
28 | % should push c.patch | |
29 | applying c.patch |
|
29 | applying c.patch | |
30 | Now at: c.patch |
|
30 | Now at: c.patch | |
31 | Patch queue now empty |
|
31 | Patch queue now empty | |
32 | guards deactivated |
|
32 | guards deactivated | |
33 | number of unguarded, unapplied patches has changed from 3 to 2 |
|
33 | number of unguarded, unapplied patches has changed from 3 to 2 | |
34 | % should push all |
|
34 | % should push all | |
35 | applying b.patch |
|
35 | applying b.patch | |
36 | applying c.patch |
|
36 | applying c.patch | |
37 | Now at: c.patch |
|
37 | Now at: c.patch | |
38 | Patch queue now empty |
|
38 | Patch queue now empty | |
39 | number of unguarded, unapplied patches has changed from 1 to 2 |
|
39 | number of unguarded, unapplied patches has changed from 1 to 2 | |
40 | % should push a.patch, not b.patch |
|
40 | % should push a.patch, not b.patch | |
41 | applying a.patch |
|
41 | applying a.patch | |
42 | Now at: a.patch |
|
42 | Now at: a.patch | |
43 | applying c.patch |
|
43 | applying c.patch | |
44 | Now at: c.patch |
|
44 | Now at: c.patch | |
45 | Patch queue now empty |
|
45 | Patch queue now empty | |
46 | % should push b.patch |
|
46 | % should push b.patch | |
47 | applying b.patch |
|
47 | applying b.patch | |
48 | Now at: b.patch |
|
48 | Now at: b.patch | |
|
49 | applying c.patch | |||
|
50 | Now at: c.patch | |||
|
51 | c.patch | |||
49 | Patch queue now empty |
|
52 | Patch queue now empty | |
50 | number of unguarded, unapplied patches has changed from 2 to 3 |
|
53 | number of unguarded, unapplied patches has changed from 2 to 3 | |
51 | % should push a.patch, b.patch |
|
54 | % should push a.patch, b.patch | |
52 | applying a.patch |
|
55 | applying a.patch | |
53 | Now at: a.patch |
|
56 | Now at: a.patch | |
54 | applying b.patch |
|
57 | applying b.patch | |
55 | Now at: b.patch |
|
58 | Now at: b.patch | |
56 | Patch queue now empty |
|
59 | Patch queue now empty | |
57 | number of unguarded, unapplied patches has changed from 3 to 2 |
|
60 | number of unguarded, unapplied patches has changed from 3 to 2 | |
58 | % list patches and guards |
|
61 | % list patches and guards | |
59 | a.patch: +1 +2 -3 |
|
62 | a.patch: +1 +2 -3 | |
60 | b.patch: +2 |
|
63 | b.patch: +2 | |
61 | c.patch: unguarded |
|
64 | c.patch: unguarded | |
62 | % list series |
|
65 | % list series | |
63 | 0 G a.patch |
|
66 | 0 G a.patch | |
64 | 1 U b.patch |
|
67 | 1 U b.patch | |
65 | 2 U c.patch |
|
68 | 2 U c.patch | |
66 | % list guards |
|
69 | % list guards | |
67 | 1 |
|
70 | 1 | |
68 | 2 |
|
71 | 2 | |
69 | 3 |
|
72 | 3 | |
70 | % should push b.patch |
|
73 | % should push b.patch | |
71 | applying b.patch |
|
74 | applying b.patch | |
72 | Now at: b.patch |
|
75 | Now at: b.patch | |
73 | applying c.patch |
|
76 | applying c.patch | |
74 | Now at: c.patch |
|
77 | Now at: c.patch | |
75 | guards deactivated |
|
78 | guards deactivated | |
76 | popping guarded patches |
|
79 | popping guarded patches | |
77 | Patch queue now empty |
|
80 | Patch queue now empty | |
78 | reapplying unguarded patches |
|
81 | reapplying unguarded patches | |
79 | applying c.patch |
|
82 | applying c.patch | |
80 | Now at: c.patch |
|
83 | Now at: c.patch | |
81 | % guards in series file: +1 +2 -3 |
|
84 | % guards in series file: +1 +2 -3 | |
82 | +1 |
|
85 | +1 | |
83 | +2 |
|
86 | +2 | |
84 | -3 |
|
87 | -3 | |
85 | % should show c.patch |
|
88 | % should show c.patch | |
86 | c.patch |
|
89 | c.patch | |
87 | % should show : |
|
90 | % should show : | |
88 | % new.patch: +1 +2 -3 |
|
91 | % new.patch: +1 +2 -3 | |
89 | % b.patch: +2 |
|
92 | % b.patch: +2 | |
90 | % c.patch: unguarded |
|
93 | % c.patch: unguarded | |
91 | new.patch: +1 +2 -3 |
|
94 | new.patch: +1 +2 -3 | |
92 | b.patch: +2 |
|
95 | b.patch: +2 | |
93 | c.patch: unguarded |
|
96 | c.patch: unguarded | |
94 | Now at: c.patch |
|
97 | Now at: c.patch | |
95 | % should show new.patch and b.patch as Guarded, c.patch as Applied |
|
98 | % should show new.patch and b.patch as Guarded, c.patch as Applied | |
96 | % and d.patch as Unapplied |
|
99 | % and d.patch as Unapplied | |
97 | 0 G new.patch |
|
100 | 0 G new.patch | |
98 | 1 G b.patch |
|
101 | 1 G b.patch | |
99 | 2 A c.patch |
|
102 | 2 A c.patch | |
100 | 3 U d.patch |
|
103 | 3 U d.patch | |
101 | % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded. |
|
104 | % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded. | |
102 | 0 G new.patch |
|
105 | 0 G new.patch | |
103 | 1 G b.patch |
|
106 | 1 G b.patch | |
104 | 2 A c.patch |
|
107 | 2 A c.patch | |
105 | 3 G d.patch |
|
108 | 3 G d.patch | |
106 | Patch queue now empty |
|
109 | Patch queue now empty | |
107 | new.patch: +1 +2 -3 |
|
110 | new.patch: +1 +2 -3 | |
108 | b.patch: +2 |
|
111 | b.patch: +2 | |
109 | c.patch: unguarded |
|
112 | c.patch: unguarded | |
110 | d.patch: +2 |
|
113 | d.patch: +2 | |
111 | % hg qapplied |
|
114 | % hg qapplied | |
112 | % hg qapplied -v |
|
115 | % hg qapplied -v | |
113 | % hg qunapplied |
|
116 | % hg qunapplied | |
114 | c.patch |
|
117 | c.patch | |
115 | % hg qunapplied -v |
|
118 | % hg qunapplied -v | |
116 | 0 G new.patch |
|
119 | 0 G new.patch | |
117 | 1 G b.patch |
|
120 | 1 G b.patch | |
118 | 2 U c.patch |
|
121 | 2 U c.patch | |
119 | 3 G d.patch |
|
122 | 3 G d.patch | |
120 | number of unguarded, unapplied patches has changed from 1 to 2 |
|
123 | number of unguarded, unapplied patches has changed from 1 to 2 | |
121 | % hg qapplied |
|
124 | % hg qapplied | |
122 | % hg qapplied -v |
|
125 | % hg qapplied -v | |
123 | % hg qunapplied |
|
126 | % hg qunapplied | |
124 | new.patch |
|
127 | new.patch | |
125 | c.patch |
|
128 | c.patch | |
126 | % hg qunapplied -v |
|
129 | % hg qunapplied -v | |
127 | 0 U new.patch |
|
130 | 0 U new.patch | |
128 | 1 G b.patch |
|
131 | 1 G b.patch | |
129 | 2 U c.patch |
|
132 | 2 U c.patch | |
130 | 3 G d.patch |
|
133 | 3 G d.patch | |
131 | applying new.patch |
|
134 | applying new.patch | |
132 | skipping b.patch - guarded by ['+2'] |
|
135 | skipping b.patch - guarded by ['+2'] | |
133 | applying c.patch |
|
136 | applying c.patch | |
134 | skipping d.patch - guarded by ['+2'] |
|
137 | skipping d.patch - guarded by ['+2'] | |
135 | Now at: c.patch |
|
138 | Now at: c.patch | |
136 | % hg qapplied |
|
139 | % hg qapplied | |
137 | new.patch |
|
140 | new.patch | |
138 | c.patch |
|
141 | c.patch | |
139 | % hg qapplied -v |
|
142 | % hg qapplied -v | |
140 | 0 A new.patch |
|
143 | 0 A new.patch | |
141 | 1 G b.patch |
|
144 | 1 G b.patch | |
142 | 2 A c.patch |
|
145 | 2 A c.patch | |
143 | % hg qunapplied |
|
146 | % hg qunapplied | |
144 | % hg qunapplied -v |
|
147 | % hg qunapplied -v | |
145 | 3 G d.patch |
|
148 | 3 G d.patch | |
146 | number of unguarded, unapplied patches has changed from 0 to 1 |
|
149 | number of unguarded, unapplied patches has changed from 0 to 1 | |
147 | number of guarded, applied patches has changed from 1 to 0 |
|
150 | number of guarded, applied patches has changed from 1 to 0 | |
148 | % hg qapplied |
|
151 | % hg qapplied | |
149 | new.patch |
|
152 | new.patch | |
150 | c.patch |
|
153 | c.patch | |
151 | % hg qapplied -v |
|
154 | % hg qapplied -v | |
152 | 0 A new.patch |
|
155 | 0 A new.patch | |
153 | 1 U b.patch |
|
156 | 1 U b.patch | |
154 | 2 A c.patch |
|
157 | 2 A c.patch | |
155 | % hg qunapplied |
|
158 | % hg qunapplied | |
156 | d.patch |
|
159 | d.patch | |
157 | % hg qunapplied -v |
|
160 | % hg qunapplied -v | |
158 | 3 U d.patch |
|
161 | 3 U d.patch | |
159 | % hg qapplied new.patch |
|
162 | % hg qapplied new.patch | |
160 | new.patch |
|
163 | new.patch | |
161 | % hg qunapplied new.patch |
|
164 | % hg qunapplied new.patch | |
162 | b.patch |
|
165 | b.patch | |
163 | d.patch |
|
166 | d.patch | |
164 | % hg qapplied b.patch |
|
167 | % hg qapplied b.patch | |
165 | new.patch |
|
168 | new.patch | |
166 | % hg qunapplied b.patch |
|
169 | % hg qunapplied b.patch | |
167 | d.patch |
|
170 | d.patch | |
168 | % hg qapplied c.patch |
|
171 | % hg qapplied c.patch | |
169 | new.patch |
|
172 | new.patch | |
170 | c.patch |
|
173 | c.patch | |
171 | % hg qunapplied c.patch |
|
174 | % hg qunapplied c.patch | |
172 | d.patch |
|
175 | d.patch | |
173 | % hg qapplied d.patch |
|
176 | % hg qapplied d.patch | |
174 | new.patch |
|
177 | new.patch | |
175 | c.patch |
|
178 | c.patch | |
176 | % hg qunapplied d.patch |
|
179 | % hg qunapplied d.patch | |
177 | % hg qseries -m: only b.patch should be shown |
|
180 | % hg qseries -m: only b.patch should be shown | |
178 | the guards file was not ignored in the past |
|
181 | the guards file was not ignored in the past | |
179 | b.patch |
|
182 | b.patch |
General Comments 0
You need to be logged in to leave comments.
Login now