##// END OF EJS Templates
Test qtop breaking when series ends with guarded patches.
Patrick Mezard -
r4405:83696720 default
parent child Browse files
Show More
@@ -1,154 +1,156 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 echo % should display b.patch
58 hg qtop
57
59
58 hg qguard -n c.patch
60 hg qguard -n c.patch
59 echo % should push c.patch
61 echo % should push c.patch
60 hg qpush -a
62 hg qpush -a
61
63
62 hg qpop -a
64 hg qpop -a
63 hg qselect -n
65 hg qselect -n
64 echo % should push all
66 echo % should push all
65 hg qpush -a
67 hg qpush -a
66
68
67 hg qpop -a
69 hg qpop -a
68 hg qguard a.patch +1
70 hg qguard a.patch +1
69 hg qguard b.patch +2
71 hg qguard b.patch +2
70 hg qselect 1
72 hg qselect 1
71 echo % should push a.patch, not b.patch
73 echo % should push a.patch, not b.patch
72 hg qpush
74 hg qpush
73 hg qpush
75 hg qpush
74 hg qpop -a
76 hg qpop -a
75
77
76 hg qselect 2
78 hg qselect 2
77 echo % should push b.patch
79 echo % should push b.patch
78 hg qpush
80 hg qpush
79 hg qpush -a
81 hg qpush -a
80 # Used to be an issue with holes in the patch sequence
82 # Used to be an issue with holes in the patch sequence
81 # So, put one hole on the base and ask for topmost patch.
83 # So, put one hole on the base and ask for topmost patch.
82 hg qtop
84 hg qtop
83 hg qpop -a
85 hg qpop -a
84
86
85 hg qselect 1 2
87 hg qselect 1 2
86 echo % should push a.patch, b.patch
88 echo % should push a.patch, b.patch
87 hg qpush
89 hg qpush
88 hg qpush
90 hg qpush
89 hg qpop -a
91 hg qpop -a
90
92
91 hg qguard a.patch +1 +2 -3
93 hg qguard a.patch +1 +2 -3
92 hg qselect 1 2 3
94 hg qselect 1 2 3
93 echo % list patches and guards
95 echo % list patches and guards
94 hg qguard -l
96 hg qguard -l
95 echo % list series
97 echo % list series
96 hg qseries -v
98 hg qseries -v
97 echo % list guards
99 echo % list guards
98 hg qselect
100 hg qselect
99 echo % should push b.patch
101 echo % should push b.patch
100 hg qpush
102 hg qpush
101
103
102 hg qpush -a
104 hg qpush -a
103 hg qselect -n --reapply
105 hg qselect -n --reapply
104 echo % guards in series file: +1 +2 -3
106 echo % guards in series file: +1 +2 -3
105 hg qselect -s
107 hg qselect -s
106 echo % should show c.patch
108 echo % should show c.patch
107 hg qapplied
109 hg qapplied
108
110
109 hg qrename a.patch new.patch
111 hg qrename a.patch new.patch
110 echo % should show :
112 echo % should show :
111 echo % new.patch: +1 +2 -3
113 echo % new.patch: +1 +2 -3
112 echo % b.patch: +2
114 echo % b.patch: +2
113 echo % c.patch: unguarded
115 echo % c.patch: unguarded
114 hg qguard -l
116 hg qguard -l
115
117
116 hg qnew d.patch
118 hg qnew d.patch
117 hg qpop
119 hg qpop
118 echo % should show new.patch and b.patch as Guarded, c.patch as Applied
120 echo % should show new.patch and b.patch as Guarded, c.patch as Applied
119 echo % and d.patch as Unapplied
121 echo % and d.patch as Unapplied
120 hg qseries -v
122 hg qseries -v
121
123
122 hg qguard d.patch +2
124 hg qguard d.patch +2
123 echo % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
125 echo % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
124 hg qseries -v
126 hg qseries -v
125
127
126 qappunappv()
128 qappunappv()
127 (
129 (
128 for command in qapplied "qapplied -v" qunapplied "qunapplied -v"; do
130 for command in qapplied "qapplied -v" qunapplied "qunapplied -v"; do
129 echo % hg $command
131 echo % hg $command
130 hg $command
132 hg $command
131 done
133 done
132 )
134 )
133
135
134 hg qpop -a
136 hg qpop -a
135 hg qguard -l
137 hg qguard -l
136 qappunappv
138 qappunappv
137 hg qselect 1
139 hg qselect 1
138 qappunappv
140 qappunappv
139 hg qpush -a
141 hg qpush -a
140 qappunappv
142 qappunappv
141 hg qselect 2
143 hg qselect 2
142 qappunappv
144 qappunappv
143
145
144 for patch in `hg qseries`; do
146 for patch in `hg qseries`; do
145 echo % hg qapplied $patch
147 echo % hg qapplied $patch
146 hg qapplied $patch
148 hg qapplied $patch
147 echo % hg qunapplied $patch
149 echo % hg qunapplied $patch
148 hg qunapplied $patch
150 hg qunapplied $patch
149 done
151 done
150
152
151 echo % hg qseries -m: only b.patch should be shown
153 echo % hg qseries -m: only b.patch should be shown
152 echo the guards file was not ignored in the past
154 echo the guards file was not ignored in the past
153 hg qdelete -k b.patch
155 hg qdelete -k b.patch
154 hg qseries -m
156 hg qseries -m
@@ -1,182 +1,184 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 display b.patch
29 b.patch
28 % should push c.patch
30 % should push c.patch
29 applying c.patch
31 applying c.patch
30 Now at: c.patch
32 Now at: c.patch
31 Patch queue now empty
33 Patch queue now empty
32 guards deactivated
34 guards deactivated
33 number of unguarded, unapplied patches has changed from 3 to 2
35 number of unguarded, unapplied patches has changed from 3 to 2
34 % should push all
36 % should push all
35 applying b.patch
37 applying b.patch
36 applying c.patch
38 applying c.patch
37 Now at: c.patch
39 Now at: c.patch
38 Patch queue now empty
40 Patch queue now empty
39 number of unguarded, unapplied patches has changed from 1 to 2
41 number of unguarded, unapplied patches has changed from 1 to 2
40 % should push a.patch, not b.patch
42 % should push a.patch, not b.patch
41 applying a.patch
43 applying a.patch
42 Now at: a.patch
44 Now at: a.patch
43 applying c.patch
45 applying c.patch
44 Now at: c.patch
46 Now at: c.patch
45 Patch queue now empty
47 Patch queue now empty
46 % should push b.patch
48 % should push b.patch
47 applying b.patch
49 applying b.patch
48 Now at: b.patch
50 Now at: b.patch
49 applying c.patch
51 applying c.patch
50 Now at: c.patch
52 Now at: c.patch
51 c.patch
53 c.patch
52 Patch queue now empty
54 Patch queue now empty
53 number of unguarded, unapplied patches has changed from 2 to 3
55 number of unguarded, unapplied patches has changed from 2 to 3
54 % should push a.patch, b.patch
56 % should push a.patch, b.patch
55 applying a.patch
57 applying a.patch
56 Now at: a.patch
58 Now at: a.patch
57 applying b.patch
59 applying b.patch
58 Now at: b.patch
60 Now at: b.patch
59 Patch queue now empty
61 Patch queue now empty
60 number of unguarded, unapplied patches has changed from 3 to 2
62 number of unguarded, unapplied patches has changed from 3 to 2
61 % list patches and guards
63 % list patches and guards
62 a.patch: +1 +2 -3
64 a.patch: +1 +2 -3
63 b.patch: +2
65 b.patch: +2
64 c.patch: unguarded
66 c.patch: unguarded
65 % list series
67 % list series
66 0 G a.patch
68 0 G a.patch
67 1 U b.patch
69 1 U b.patch
68 2 U c.patch
70 2 U c.patch
69 % list guards
71 % list guards
70 1
72 1
71 2
73 2
72 3
74 3
73 % should push b.patch
75 % should push b.patch
74 applying b.patch
76 applying b.patch
75 Now at: b.patch
77 Now at: b.patch
76 applying c.patch
78 applying c.patch
77 Now at: c.patch
79 Now at: c.patch
78 guards deactivated
80 guards deactivated
79 popping guarded patches
81 popping guarded patches
80 Patch queue now empty
82 Patch queue now empty
81 reapplying unguarded patches
83 reapplying unguarded patches
82 applying c.patch
84 applying c.patch
83 Now at: c.patch
85 Now at: c.patch
84 % guards in series file: +1 +2 -3
86 % guards in series file: +1 +2 -3
85 +1
87 +1
86 +2
88 +2
87 -3
89 -3
88 % should show c.patch
90 % should show c.patch
89 c.patch
91 c.patch
90 % should show :
92 % should show :
91 % new.patch: +1 +2 -3
93 % new.patch: +1 +2 -3
92 % b.patch: +2
94 % b.patch: +2
93 % c.patch: unguarded
95 % c.patch: unguarded
94 new.patch: +1 +2 -3
96 new.patch: +1 +2 -3
95 b.patch: +2
97 b.patch: +2
96 c.patch: unguarded
98 c.patch: unguarded
97 Now at: c.patch
99 Now at: c.patch
98 % should show new.patch and b.patch as Guarded, c.patch as Applied
100 % should show new.patch and b.patch as Guarded, c.patch as Applied
99 % and d.patch as Unapplied
101 % and d.patch as Unapplied
100 0 G new.patch
102 0 G new.patch
101 1 G b.patch
103 1 G b.patch
102 2 A c.patch
104 2 A c.patch
103 3 U d.patch
105 3 U d.patch
104 % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
106 % new.patch, b.patch: Guarded. c.patch: Applied. d.patch: Guarded.
105 0 G new.patch
107 0 G new.patch
106 1 G b.patch
108 1 G b.patch
107 2 A c.patch
109 2 A c.patch
108 3 G d.patch
110 3 G d.patch
109 Patch queue now empty
111 Patch queue now empty
110 new.patch: +1 +2 -3
112 new.patch: +1 +2 -3
111 b.patch: +2
113 b.patch: +2
112 c.patch: unguarded
114 c.patch: unguarded
113 d.patch: +2
115 d.patch: +2
114 % hg qapplied
116 % hg qapplied
115 % hg qapplied -v
117 % hg qapplied -v
116 % hg qunapplied
118 % hg qunapplied
117 c.patch
119 c.patch
118 % hg qunapplied -v
120 % hg qunapplied -v
119 0 G new.patch
121 0 G new.patch
120 1 G b.patch
122 1 G b.patch
121 2 U c.patch
123 2 U c.patch
122 3 G d.patch
124 3 G d.patch
123 number of unguarded, unapplied patches has changed from 1 to 2
125 number of unguarded, unapplied patches has changed from 1 to 2
124 % hg qapplied
126 % hg qapplied
125 % hg qapplied -v
127 % hg qapplied -v
126 % hg qunapplied
128 % hg qunapplied
127 new.patch
129 new.patch
128 c.patch
130 c.patch
129 % hg qunapplied -v
131 % hg qunapplied -v
130 0 U new.patch
132 0 U new.patch
131 1 G b.patch
133 1 G b.patch
132 2 U c.patch
134 2 U c.patch
133 3 G d.patch
135 3 G d.patch
134 applying new.patch
136 applying new.patch
135 skipping b.patch - guarded by ['+2']
137 skipping b.patch - guarded by ['+2']
136 applying c.patch
138 applying c.patch
137 skipping d.patch - guarded by ['+2']
139 skipping d.patch - guarded by ['+2']
138 Now at: c.patch
140 Now at: c.patch
139 % hg qapplied
141 % hg qapplied
140 new.patch
142 new.patch
141 c.patch
143 c.patch
142 % hg qapplied -v
144 % hg qapplied -v
143 0 A new.patch
145 0 A new.patch
144 1 G b.patch
146 1 G b.patch
145 2 A c.patch
147 2 A c.patch
146 % hg qunapplied
148 % hg qunapplied
147 % hg qunapplied -v
149 % hg qunapplied -v
148 3 G d.patch
150 3 G d.patch
149 number of unguarded, unapplied patches has changed from 0 to 1
151 number of unguarded, unapplied patches has changed from 0 to 1
150 number of guarded, applied patches has changed from 1 to 0
152 number of guarded, applied patches has changed from 1 to 0
151 % hg qapplied
153 % hg qapplied
152 new.patch
154 new.patch
153 c.patch
155 c.patch
154 % hg qapplied -v
156 % hg qapplied -v
155 0 A new.patch
157 0 A new.patch
156 1 U b.patch
158 1 U b.patch
157 2 A c.patch
159 2 A c.patch
158 % hg qunapplied
160 % hg qunapplied
159 d.patch
161 d.patch
160 % hg qunapplied -v
162 % hg qunapplied -v
161 3 U d.patch
163 3 U d.patch
162 % hg qapplied new.patch
164 % hg qapplied new.patch
163 new.patch
165 new.patch
164 % hg qunapplied new.patch
166 % hg qunapplied new.patch
165 b.patch
167 b.patch
166 d.patch
168 d.patch
167 % hg qapplied b.patch
169 % hg qapplied b.patch
168 new.patch
170 new.patch
169 % hg qunapplied b.patch
171 % hg qunapplied b.patch
170 d.patch
172 d.patch
171 % hg qapplied c.patch
173 % hg qapplied c.patch
172 new.patch
174 new.patch
173 c.patch
175 c.patch
174 % hg qunapplied c.patch
176 % hg qunapplied c.patch
175 d.patch
177 d.patch
176 % hg qapplied d.patch
178 % hg qapplied d.patch
177 new.patch
179 new.patch
178 c.patch
180 c.patch
179 % hg qunapplied d.patch
181 % hg qunapplied d.patch
180 % hg qseries -m: only b.patch should be shown
182 % hg qseries -m: only b.patch should be shown
181 the guards file was not ignored in the past
183 the guards file was not ignored in the past
182 b.patch
184 b.patch
General Comments 0
You need to be logged in to leave comments. Login now