##// END OF EJS Templates
tests: test-mq-subrepo.t Solaris 10 sh compliance...
Mads Kiilerich -
r13510:d0be955f stable
parent child Browse files
Show More
@@ -1,347 +1,350
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
2 $ echo "mq=" >> $HGRCPATH
3 $ echo "record=" >> $HGRCPATH
3 $ echo "record=" >> $HGRCPATH
4 $ echo "[diff]" >> $HGRCPATH
4 $ echo "[diff]" >> $HGRCPATH
5 $ echo "nodates=1" >> $HGRCPATH
5 $ echo "nodates=1" >> $HGRCPATH
6
6
7 $ stdin=`pwd`/stdin.tmp
7 $ stdin=`pwd`/stdin.tmp
8
8
9 fn to create new repository w/dirty subrepo, and cd into it
9 fn to create new repository w/dirty subrepo, and cd into it
10 $ mkrepo() {
10 $ mkrepo() {
11 > hg init $1
11 > hg init $1
12 > cd $1
12 > cd $1
13 > hg qinit
13 > hg qinit
14 > }
14 > }
15
15
16 fn to create dirty subrepo
16 fn to create dirty subrepo
17 $ mksubrepo() {
17 $ mksubrepo() {
18 > hg init $1
18 > hg init $1
19 > cd $1
19 > cd $1
20 > echo a > a
20 > echo a > a
21 > hg add
21 > hg add
22 > cd ..
22 > cd ..
23 > }
23 > }
24
24
25 $ testadd() {
25 $ testadd() {
26 > cat - > "$stdin"
26 > cat - > "$stdin"
27 > mksubrepo sub
27 > mksubrepo sub
28 > echo sub = sub >> .hgsub
28 > echo sub = sub >> .hgsub
29 > hg add .hgsub
29 > hg add .hgsub
30 > echo % abort when adding .hgsub w/dirty subrepo
30 > echo % abort when adding .hgsub w/dirty subrepo
31 > hg status -S
31 > hg status -S
32 > echo '%' $*
32 > echo '%' $*
33 > cat "$stdin" | hg $*
33 > cat "$stdin" | hg $*
34 > echo [$?]
34 > echo [$?]
35 > hg -R sub ci -m0sub
35 > hg -R sub ci -m0sub
36 > echo % update substate when adding .hgsub w/clean updated subrepo
36 > echo % update substate when adding .hgsub w/clean updated subrepo
37 > hg status -S
37 > hg status -S
38 > echo '%' $*
38 > echo '%' $*
39 > cat "$stdin" | hg $*
39 > cat "$stdin" | hg $*
40 > hg debugsub
40 > hg debugsub
41 > }
41 > }
42
42
43 $ testmod() {
43 $ testmod() {
44 > cat - > "$stdin"
44 > cat - > "$stdin"
45 > mksubrepo sub2
45 > mksubrepo sub2
46 > echo sub2 = sub2 >> .hgsub
46 > echo sub2 = sub2 >> .hgsub
47 > echo % abort when modifying .hgsub w/dirty subrepo
47 > echo % abort when modifying .hgsub w/dirty subrepo
48 > hg status -S
48 > hg status -S
49 > echo '%' $*
49 > echo '%' $*
50 > cat "$stdin" | hg $*
50 > cat "$stdin" | hg $*
51 > echo [$?]
51 > echo [$?]
52 > hg -R sub2 ci -m0sub2
52 > hg -R sub2 ci -m0sub2
53 > echo % update substate when modifying .hgsub w/clean updated subrepo
53 > echo % update substate when modifying .hgsub w/clean updated subrepo
54 > hg status -S
54 > hg status -S
55 > echo '%' $*
55 > echo '%' $*
56 > cat "$stdin" | hg $*
56 > cat "$stdin" | hg $*
57 > hg debugsub
57 > hg debugsub
58 > }
58 > }
59
59
60 $ testrm1() {
60 $ testrm1() {
61 > cat - > "$stdin"
61 > cat - > "$stdin"
62 > mksubrepo sub3
62 > mksubrepo sub3
63 > echo sub3 = sub3 >> .hgsub
63 > echo sub3 = sub3 >> .hgsub
64 > hg ci -Aqmsub3
64 > hg ci -Aqmsub3
65 > $EXTRA
65 > $EXTRA
66 > echo b >> sub3/a
66 > echo b >> sub3/a
67 > hg rm .hgsub
67 > hg rm .hgsub
68 > echo % update substate when removing .hgsub w/dirty subrepo
68 > echo % update substate when removing .hgsub w/dirty subrepo
69 > hg status -S
69 > hg status -S
70 > echo '%' $*
70 > echo '%' $*
71 > cat "$stdin" | hg $*
71 > cat "$stdin" | hg $*
72 > echo % debugsub should be empty
72 > echo % debugsub should be empty
73 > hg debugsub
73 > hg debugsub
74 > }
74 > }
75
75
76 $ testrm2() {
76 $ testrm2() {
77 > cat - > "$stdin"
77 > cat - > "$stdin"
78 > mksubrepo sub4
78 > mksubrepo sub4
79 > echo sub4 = sub4 >> .hgsub
79 > echo sub4 = sub4 >> .hgsub
80 > hg ci -Aqmsub4
80 > hg ci -Aqmsub4
81 > $EXTRA
81 > $EXTRA
82 > hg rm .hgsub
82 > hg rm .hgsub
83 > echo % update substate when removing .hgsub w/clean updated subrepo
83 > echo % update substate when removing .hgsub w/clean updated subrepo
84 > hg status -S
84 > hg status -S
85 > echo '%' $*
85 > echo '%' $*
86 > cat "$stdin" | hg $*
86 > cat "$stdin" | hg $*
87 > echo % debugsub should be empty
87 > echo % debugsub should be empty
88 > hg debugsub
88 > hg debugsub
89 > }
89 > }
90
90
91
91
92 handle subrepos safely on qnew
92 handle subrepos safely on qnew
93
93
94 $ mkrepo repo-2499-qnew
94 $ mkrepo repo-2499-qnew
95 $ testadd qnew -m0 0.diff
95 $ testadd qnew -m0 0.diff
96 adding a
96 adding a
97 % abort when adding .hgsub w/dirty subrepo
97 % abort when adding .hgsub w/dirty subrepo
98 A .hgsub
98 A .hgsub
99 A sub/a
99 A sub/a
100 % qnew -m0 0.diff
100 % qnew -m0 0.diff
101 abort: uncommitted changes in subrepository sub
101 abort: uncommitted changes in subrepository sub
102 [255]
102 [255]
103 % update substate when adding .hgsub w/clean updated subrepo
103 % update substate when adding .hgsub w/clean updated subrepo
104 A .hgsub
104 A .hgsub
105 % qnew -m0 0.diff
105 % qnew -m0 0.diff
106 committing subrepository sub
106 committing subrepository sub
107 path sub
107 path sub
108 source sub
108 source sub
109 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
109 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
110
110
111 $ testmod qnew -m1 1.diff
111 $ testmod qnew -m1 1.diff
112 adding a
112 adding a
113 % abort when modifying .hgsub w/dirty subrepo
113 % abort when modifying .hgsub w/dirty subrepo
114 M .hgsub
114 M .hgsub
115 A sub2/a
115 A sub2/a
116 % qnew -m1 1.diff
116 % qnew -m1 1.diff
117 abort: uncommitted changes in subrepository sub2
117 abort: uncommitted changes in subrepository sub2
118 [255]
118 [255]
119 % update substate when modifying .hgsub w/clean updated subrepo
119 % update substate when modifying .hgsub w/clean updated subrepo
120 M .hgsub
120 M .hgsub
121 % qnew -m1 1.diff
121 % qnew -m1 1.diff
122 committing subrepository sub2
122 committing subrepository sub2
123 path sub
123 path sub
124 source sub
124 source sub
125 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
125 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
126 path sub2
126 path sub2
127 source sub2
127 source sub2
128 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
128 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
129
129
130 $ hg qpop -qa
130 $ hg qpop -qa
131 patch queue now empty
131 patch queue now empty
132 $ testrm1 qnew -m2 2.diff
132 $ testrm1 qnew -m2 2.diff
133 adding a
133 adding a
134 % update substate when removing .hgsub w/dirty subrepo
134 % update substate when removing .hgsub w/dirty subrepo
135 M sub3/a
135 M sub3/a
136 R .hgsub
136 R .hgsub
137 % qnew -m2 2.diff
137 % qnew -m2 2.diff
138 % debugsub should be empty
138 % debugsub should be empty
139
139
140 $ hg qpop -qa
140 $ hg qpop -qa
141 patch queue now empty
141 patch queue now empty
142 $ testrm2 qnew -m3 3.diff
142 $ testrm2 qnew -m3 3.diff
143 adding a
143 adding a
144 % update substate when removing .hgsub w/clean updated subrepo
144 % update substate when removing .hgsub w/clean updated subrepo
145 R .hgsub
145 R .hgsub
146 % qnew -m3 3.diff
146 % qnew -m3 3.diff
147 % debugsub should be empty
147 % debugsub should be empty
148
148
149 $ cd ..
149 $ cd ..
150
150
151
151
152 handle subrepos safely on qrefresh
152 handle subrepos safely on qrefresh
153
153
154 $ mkrepo repo-2499-qrefresh
154 $ mkrepo repo-2499-qrefresh
155 $ hg qnew -m0 0.diff
155 $ hg qnew -m0 0.diff
156 $ testadd qrefresh
156 $ testadd qrefresh
157 adding a
157 adding a
158 % abort when adding .hgsub w/dirty subrepo
158 % abort when adding .hgsub w/dirty subrepo
159 A .hgsub
159 A .hgsub
160 A sub/a
160 A sub/a
161 % qrefresh
161 % qrefresh
162 abort: uncommitted changes in subrepository sub
162 abort: uncommitted changes in subrepository sub
163 [255]
163 [255]
164 % update substate when adding .hgsub w/clean updated subrepo
164 % update substate when adding .hgsub w/clean updated subrepo
165 A .hgsub
165 A .hgsub
166 % qrefresh
166 % qrefresh
167 committing subrepository sub
167 committing subrepository sub
168 path sub
168 path sub
169 source sub
169 source sub
170 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
170 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
171
171
172 $ hg qnew -m1 1.diff
172 $ hg qnew -m1 1.diff
173 $ testmod qrefresh
173 $ testmod qrefresh
174 adding a
174 adding a
175 % abort when modifying .hgsub w/dirty subrepo
175 % abort when modifying .hgsub w/dirty subrepo
176 M .hgsub
176 M .hgsub
177 A sub2/a
177 A sub2/a
178 % qrefresh
178 % qrefresh
179 abort: uncommitted changes in subrepository sub2
179 abort: uncommitted changes in subrepository sub2
180 [255]
180 [255]
181 % update substate when modifying .hgsub w/clean updated subrepo
181 % update substate when modifying .hgsub w/clean updated subrepo
182 M .hgsub
182 M .hgsub
183 % qrefresh
183 % qrefresh
184 committing subrepository sub2
184 committing subrepository sub2
185 path sub
185 path sub
186 source sub
186 source sub
187 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
187 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
188 path sub2
188 path sub2
189 source sub2
189 source sub2
190 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
190 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
191
191
192 $ hg qpop -qa
192 $ hg qpop -qa
193 patch queue now empty
193 patch queue now empty
194 $ EXTRA='hg qnew -m2 2.diff' testrm1 qrefresh
194 $ EXTRA='hg qnew -m2 2.diff'
195 $ testrm1 qrefresh
195 adding a
196 adding a
196 % update substate when removing .hgsub w/dirty subrepo
197 % update substate when removing .hgsub w/dirty subrepo
197 M sub3/a
198 M sub3/a
198 R .hgsub
199 R .hgsub
199 % qrefresh
200 % qrefresh
200 % debugsub should be empty
201 % debugsub should be empty
201
202
202 $ hg qpop -qa
203 $ hg qpop -qa
203 patch queue now empty
204 patch queue now empty
204 $ EXTRA='hg qnew -m3 3.diff' testrm2 qrefresh
205 $ EXTRA='hg qnew -m3 3.diff'
206 $ testrm2 qrefresh
205 adding a
207 adding a
206 % update substate when removing .hgsub w/clean updated subrepo
208 % update substate when removing .hgsub w/clean updated subrepo
207 R .hgsub
209 R .hgsub
208 % qrefresh
210 % qrefresh
209 % debugsub should be empty
211 % debugsub should be empty
212 $ EXTRA=
210
213
211 $ cd ..
214 $ cd ..
212
215
213
216
214 handle subrepos safely on qpush/qpop
217 handle subrepos safely on qpush/qpop
215
218
216 $ mkrepo repo-2499-qpush
219 $ mkrepo repo-2499-qpush
217 $ mksubrepo sub
220 $ mksubrepo sub
218 adding a
221 adding a
219 $ hg -R sub ci -m0sub
222 $ hg -R sub ci -m0sub
220 $ echo sub = sub > .hgsub
223 $ echo sub = sub > .hgsub
221 $ hg add .hgsub
224 $ hg add .hgsub
222 $ hg qnew -m0 0.diff
225 $ hg qnew -m0 0.diff
223 committing subrepository sub
226 committing subrepository sub
224 $ hg debugsub
227 $ hg debugsub
225 path sub
228 path sub
226 source sub
229 source sub
227 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
230 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
228
231
229 qpop
232 qpop
230 $ hg qpop
233 $ hg qpop
231 popping 0.diff
234 popping 0.diff
232 patch queue now empty
235 patch queue now empty
233 $ hg status -AS
236 $ hg status -AS
234 $ hg debugsub
237 $ hg debugsub
235
238
236 qpush
239 qpush
237 $ hg qpush
240 $ hg qpush
238 applying 0.diff
241 applying 0.diff
239 now at: 0.diff
242 now at: 0.diff
240 $ hg status -AS
243 $ hg status -AS
241 C .hgsub
244 C .hgsub
242 C .hgsubstate
245 C .hgsubstate
243 C sub/a
246 C sub/a
244 $ hg debugsub
247 $ hg debugsub
245 path sub
248 path sub
246 source sub
249 source sub
247 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
250 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
248
251
249 $ cd ..
252 $ cd ..
250
253
251
254
252 handle subrepos safely on qrecord
255 handle subrepos safely on qrecord
253
256
254 $ mkrepo repo-2499-qrecord
257 $ mkrepo repo-2499-qrecord
255 $ testadd qrecord --config ui.interactive=1 -m0 0.diff <<EOF
258 $ testadd qrecord --config ui.interactive=1 -m0 0.diff <<EOF
256 > y
259 > y
257 > y
260 > y
258 > EOF
261 > EOF
259 adding a
262 adding a
260 % abort when adding .hgsub w/dirty subrepo
263 % abort when adding .hgsub w/dirty subrepo
261 A .hgsub
264 A .hgsub
262 A sub/a
265 A sub/a
263 % qrecord --config ui.interactive=1 -m0 0.diff
266 % qrecord --config ui.interactive=1 -m0 0.diff
264 diff --git a/.hgsub b/.hgsub
267 diff --git a/.hgsub b/.hgsub
265 new file mode 100644
268 new file mode 100644
266 examine changes to '.hgsub'? [Ynsfdaq?]
269 examine changes to '.hgsub'? [Ynsfdaq?]
267 abort: uncommitted changes in subrepository sub
270 abort: uncommitted changes in subrepository sub
268 [255]
271 [255]
269 % update substate when adding .hgsub w/clean updated subrepo
272 % update substate when adding .hgsub w/clean updated subrepo
270 A .hgsub
273 A .hgsub
271 % qrecord --config ui.interactive=1 -m0 0.diff
274 % qrecord --config ui.interactive=1 -m0 0.diff
272 diff --git a/.hgsub b/.hgsub
275 diff --git a/.hgsub b/.hgsub
273 new file mode 100644
276 new file mode 100644
274 examine changes to '.hgsub'? [Ynsfdaq?]
277 examine changes to '.hgsub'? [Ynsfdaq?]
275 committing subrepository sub
278 committing subrepository sub
276 path sub
279 path sub
277 source sub
280 source sub
278 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
281 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
279
282
280 $ testmod qrecord --config ui.interactive=1 -m1 1.diff <<EOF
283 $ testmod qrecord --config ui.interactive=1 -m1 1.diff <<EOF
281 > y
284 > y
282 > y
285 > y
283 > EOF
286 > EOF
284 adding a
287 adding a
285 % abort when modifying .hgsub w/dirty subrepo
288 % abort when modifying .hgsub w/dirty subrepo
286 M .hgsub
289 M .hgsub
287 A sub2/a
290 A sub2/a
288 % qrecord --config ui.interactive=1 -m1 1.diff
291 % qrecord --config ui.interactive=1 -m1 1.diff
289 diff --git a/.hgsub b/.hgsub
292 diff --git a/.hgsub b/.hgsub
290 1 hunks, 1 lines changed
293 1 hunks, 1 lines changed
291 examine changes to '.hgsub'? [Ynsfdaq?]
294 examine changes to '.hgsub'? [Ynsfdaq?]
292 @@ -1,1 +1,2 @@
295 @@ -1,1 +1,2 @@
293 sub = sub
296 sub = sub
294 +sub2 = sub2
297 +sub2 = sub2
295 record this change to '.hgsub'? [Ynsfdaq?]
298 record this change to '.hgsub'? [Ynsfdaq?]
296 abort: uncommitted changes in subrepository sub2
299 abort: uncommitted changes in subrepository sub2
297 [255]
300 [255]
298 % update substate when modifying .hgsub w/clean updated subrepo
301 % update substate when modifying .hgsub w/clean updated subrepo
299 M .hgsub
302 M .hgsub
300 % qrecord --config ui.interactive=1 -m1 1.diff
303 % qrecord --config ui.interactive=1 -m1 1.diff
301 diff --git a/.hgsub b/.hgsub
304 diff --git a/.hgsub b/.hgsub
302 1 hunks, 1 lines changed
305 1 hunks, 1 lines changed
303 examine changes to '.hgsub'? [Ynsfdaq?]
306 examine changes to '.hgsub'? [Ynsfdaq?]
304 @@ -1,1 +1,2 @@
307 @@ -1,1 +1,2 @@
305 sub = sub
308 sub = sub
306 +sub2 = sub2
309 +sub2 = sub2
307 record this change to '.hgsub'? [Ynsfdaq?]
310 record this change to '.hgsub'? [Ynsfdaq?]
308 committing subrepository sub2
311 committing subrepository sub2
309 path sub
312 path sub
310 source sub
313 source sub
311 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
314 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
312 path sub2
315 path sub2
313 source sub2
316 source sub2
314 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
317 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
315
318
316 $ hg qpop -qa
319 $ hg qpop -qa
317 patch queue now empty
320 patch queue now empty
318 $ EXTRA= testrm1 qrecord --config ui.interactive=1 -m2 2.diff <<EOF
321 $ testrm1 qrecord --config ui.interactive=1 -m2 2.diff <<EOF
319 > y
322 > y
320 > y
323 > y
321 > EOF
324 > EOF
322 adding a
325 adding a
323 % update substate when removing .hgsub w/dirty subrepo
326 % update substate when removing .hgsub w/dirty subrepo
324 M sub3/a
327 M sub3/a
325 R .hgsub
328 R .hgsub
326 % qrecord --config ui.interactive=1 -m2 2.diff
329 % qrecord --config ui.interactive=1 -m2 2.diff
327 diff --git a/.hgsub b/.hgsub
330 diff --git a/.hgsub b/.hgsub
328 deleted file mode 100644
331 deleted file mode 100644
329 examine changes to '.hgsub'? [Ynsfdaq?]
332 examine changes to '.hgsub'? [Ynsfdaq?]
330 % debugsub should be empty
333 % debugsub should be empty
331
334
332 $ hg qpop -qa
335 $ hg qpop -qa
333 patch queue now empty
336 patch queue now empty
334 $ EXTRA= testrm2 qrecord --config ui.interactive=1 -m3 3.diff <<EOF
337 $ testrm2 qrecord --config ui.interactive=1 -m3 3.diff <<EOF
335 > y
338 > y
336 > y
339 > y
337 > EOF
340 > EOF
338 adding a
341 adding a
339 % update substate when removing .hgsub w/clean updated subrepo
342 % update substate when removing .hgsub w/clean updated subrepo
340 R .hgsub
343 R .hgsub
341 % qrecord --config ui.interactive=1 -m3 3.diff
344 % qrecord --config ui.interactive=1 -m3 3.diff
342 diff --git a/.hgsub b/.hgsub
345 diff --git a/.hgsub b/.hgsub
343 deleted file mode 100644
346 deleted file mode 100644
344 examine changes to '.hgsub'? [Ynsfdaq?]
347 examine changes to '.hgsub'? [Ynsfdaq?]
345 % debugsub should be empty
348 % debugsub should be empty
346
349
347 $ cd ..
350 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now