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