##// END OF EJS Templates
grammar: rolled-back
timeless@mozdev.org -
r17529:b61a6271 default
parent child Browse files
Show More
@@ -1,514 +1,514 b''
1 1 $ echo "[ui]" >> $HGRCPATH
2 2 $ echo "commitsubrepos = Yes" >> $HGRCPATH
3 3 $ echo "[extensions]" >> $HGRCPATH
4 4 $ echo "mq=" >> $HGRCPATH
5 5 $ echo "record=" >> $HGRCPATH
6 6 $ echo "[diff]" >> $HGRCPATH
7 7 $ echo "nodates=1" >> $HGRCPATH
8 8
9 9 $ stdin=`pwd`/stdin.tmp
10 10
11 11 fn to create new repository w/dirty subrepo, and cd into it
12 12 $ mkrepo() {
13 13 > hg init $1
14 14 > cd $1
15 15 > hg qinit
16 16 > }
17 17
18 18 fn to create dirty subrepo
19 19 $ mksubrepo() {
20 20 > hg init $1
21 21 > cd $1
22 22 > echo a > a
23 23 > hg add
24 24 > cd ..
25 25 > }
26 26
27 27 $ testadd() {
28 28 > cat - > "$stdin"
29 29 > mksubrepo sub
30 30 > echo sub = sub >> .hgsub
31 31 > hg add .hgsub
32 32 > echo % abort when adding .hgsub w/dirty subrepo
33 33 > hg status -S
34 34 > echo '%' $*
35 35 > cat "$stdin" | hg $*
36 36 > echo [$?]
37 37 > hg -R sub ci -m0sub
38 38 > echo % update substate when adding .hgsub w/clean updated subrepo
39 39 > hg status -S
40 40 > echo '%' $*
41 41 > cat "$stdin" | hg $*
42 42 > hg debugsub
43 43 > }
44 44
45 45 $ testmod() {
46 46 > cat - > "$stdin"
47 47 > mksubrepo sub2
48 48 > echo sub2 = sub2 >> .hgsub
49 49 > echo % abort when modifying .hgsub w/dirty subrepo
50 50 > hg status -S
51 51 > echo '%' $*
52 52 > cat "$stdin" | hg $*
53 53 > echo [$?]
54 54 > hg -R sub2 ci -m0sub2
55 55 > echo % update substate when modifying .hgsub w/clean updated subrepo
56 56 > hg status -S
57 57 > echo '%' $*
58 58 > cat "$stdin" | hg $*
59 59 > hg debugsub
60 60 > }
61 61
62 62 $ testrm1() {
63 63 > cat - > "$stdin"
64 64 > mksubrepo sub3
65 65 > echo sub3 = sub3 >> .hgsub
66 66 > hg ci -Aqmsub3
67 67 > $EXTRA
68 68 > echo b >> sub3/a
69 69 > hg rm .hgsub
70 70 > echo % update substate when removing .hgsub w/dirty subrepo
71 71 > hg status -S
72 72 > echo '%' $*
73 73 > cat "$stdin" | hg $*
74 74 > echo % debugsub should be empty
75 75 > hg debugsub
76 76 > }
77 77
78 78 $ testrm2() {
79 79 > cat - > "$stdin"
80 80 > mksubrepo sub4
81 81 > echo sub4 = sub4 >> .hgsub
82 82 > hg ci -Aqmsub4
83 83 > $EXTRA
84 84 > hg rm .hgsub
85 85 > echo % update substate when removing .hgsub w/clean updated subrepo
86 86 > hg status -S
87 87 > echo '%' $*
88 88 > cat "$stdin" | hg $*
89 89 > echo % debugsub should be empty
90 90 > hg debugsub
91 91 > }
92 92
93 93
94 94 handle subrepos safely on qnew
95 95
96 96 $ mkrepo repo-2499-qnew
97 97 $ testadd qnew -m0 0.diff
98 98 adding a
99 99 % abort when adding .hgsub w/dirty subrepo
100 100 A .hgsub
101 101 A sub/a
102 102 % qnew -m0 0.diff
103 103 abort: uncommitted changes in subrepository sub
104 104 [255]
105 105 % update substate when adding .hgsub w/clean updated subrepo
106 106 A .hgsub
107 107 % qnew -m0 0.diff
108 108 path sub
109 109 source sub
110 110 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
111 111
112 112 $ testmod qnew -m1 1.diff
113 113 adding a
114 114 % abort when modifying .hgsub w/dirty subrepo
115 115 M .hgsub
116 116 A sub2/a
117 117 % qnew -m1 1.diff
118 118 abort: uncommitted changes in subrepository sub2
119 119 [255]
120 120 % update substate when modifying .hgsub w/clean updated subrepo
121 121 M .hgsub
122 122 % qnew -m1 1.diff
123 123 path sub
124 124 source sub
125 125 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
126 126 path sub2
127 127 source sub2
128 128 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
129 129
130 130 $ hg qpop -qa
131 131 patch queue now empty
132 132 $ testrm1 qnew -m2 2.diff
133 133 adding a
134 134 % update substate when removing .hgsub w/dirty subrepo
135 135 M sub3/a
136 136 R .hgsub
137 137 % qnew -m2 2.diff
138 138 % debugsub should be empty
139 139
140 140 $ hg qpop -qa
141 141 patch queue now empty
142 142 $ testrm2 qnew -m3 3.diff
143 143 adding a
144 144 % update substate when removing .hgsub w/clean updated subrepo
145 145 R .hgsub
146 146 % qnew -m3 3.diff
147 147 % debugsub should be empty
148 148
149 149 $ cd ..
150 150
151 151
152 152 handle subrepos safely on qrefresh
153 153
154 154 $ mkrepo repo-2499-qrefresh
155 155 $ hg qnew -m0 0.diff
156 156 $ testadd qrefresh
157 157 adding a
158 158 % abort when adding .hgsub w/dirty subrepo
159 159 A .hgsub
160 160 A sub/a
161 161 % qrefresh
162 162 abort: uncommitted changes in subrepository sub
163 163 [255]
164 164 % update substate when adding .hgsub w/clean updated subrepo
165 165 A .hgsub
166 166 % qrefresh
167 167 path sub
168 168 source sub
169 169 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
170 170
171 171 $ hg qnew -m1 1.diff
172 172 $ testmod qrefresh
173 173 adding a
174 174 % abort when modifying .hgsub w/dirty subrepo
175 175 M .hgsub
176 176 A sub2/a
177 177 % qrefresh
178 178 abort: uncommitted changes in subrepository sub2
179 179 [255]
180 180 % update substate when modifying .hgsub w/clean updated subrepo
181 181 M .hgsub
182 182 % qrefresh
183 183 path sub
184 184 source sub
185 185 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
186 186 path sub2
187 187 source sub2
188 188 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
189 189
190 190 $ hg qpop -qa
191 191 patch queue now empty
192 192 $ EXTRA='hg qnew -m2 2.diff'
193 193 $ testrm1 qrefresh
194 194 adding a
195 195 % update substate when removing .hgsub w/dirty subrepo
196 196 M sub3/a
197 197 R .hgsub
198 198 % qrefresh
199 199 % debugsub should be empty
200 200
201 201 $ hg qpop -qa
202 202 patch queue now empty
203 203 $ EXTRA='hg qnew -m3 3.diff'
204 204 $ testrm2 qrefresh
205 205 adding a
206 206 % update substate when removing .hgsub w/clean updated subrepo
207 207 R .hgsub
208 208 % qrefresh
209 209 % debugsub should be empty
210 210 $ EXTRA=
211 211
212 212 $ cd ..
213 213
214 214
215 215 handle subrepos safely on qpush/qpop
216 216
217 217 $ mkrepo repo-2499-qpush
218 218 $ mksubrepo sub
219 219 adding a
220 220 $ hg -R sub ci -m0sub
221 221 $ echo sub = sub > .hgsub
222 222 $ hg add .hgsub
223 223 $ hg qnew -m0 0.diff
224 224 $ hg debugsub
225 225 path sub
226 226 source sub
227 227 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
228 228
229 229 qpop
230 230 $ hg qpop
231 231 popping 0.diff
232 232 patch queue now empty
233 233 $ hg status -AS
234 234 $ hg debugsub
235 235
236 236 qpush
237 237 $ hg qpush
238 238 applying 0.diff
239 239 now at: 0.diff
240 240 $ hg status -AS
241 241 C .hgsub
242 242 C .hgsubstate
243 243 C sub/a
244 244 $ hg debugsub
245 245 path sub
246 246 source sub
247 247 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
248 248
249 249 $ cd ..
250 250
251 251
252 252 handle subrepos safely on qrecord
253 253
254 254 $ mkrepo repo-2499-qrecord
255 255 $ testadd qrecord --config ui.interactive=1 -m0 0.diff <<EOF
256 256 > y
257 257 > y
258 258 > EOF
259 259 adding a
260 260 % abort when adding .hgsub w/dirty subrepo
261 261 A .hgsub
262 262 A sub/a
263 263 % qrecord --config ui.interactive=1 -m0 0.diff
264 264 diff --git a/.hgsub b/.hgsub
265 265 new file mode 100644
266 266 examine changes to '.hgsub'? [Ynesfdaq?]
267 267 abort: uncommitted changes in subrepository sub
268 268 [255]
269 269 % update substate when adding .hgsub w/clean updated subrepo
270 270 A .hgsub
271 271 % qrecord --config ui.interactive=1 -m0 0.diff
272 272 diff --git a/.hgsub b/.hgsub
273 273 new file mode 100644
274 274 examine changes to '.hgsub'? [Ynesfdaq?]
275 275 path sub
276 276 source sub
277 277 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
278 278
279 279 $ testmod qrecord --config ui.interactive=1 -m1 1.diff <<EOF
280 280 > y
281 281 > y
282 282 > EOF
283 283 adding a
284 284 % abort when modifying .hgsub w/dirty subrepo
285 285 M .hgsub
286 286 A sub2/a
287 287 % qrecord --config ui.interactive=1 -m1 1.diff
288 288 diff --git a/.hgsub b/.hgsub
289 289 1 hunks, 1 lines changed
290 290 examine changes to '.hgsub'? [Ynesfdaq?]
291 291 @@ -1,1 +1,2 @@
292 292 sub = sub
293 293 +sub2 = sub2
294 294 record this change to '.hgsub'? [Ynesfdaq?]
295 295 abort: uncommitted changes in subrepository sub2
296 296 [255]
297 297 % update substate when modifying .hgsub w/clean updated subrepo
298 298 M .hgsub
299 299 % qrecord --config ui.interactive=1 -m1 1.diff
300 300 diff --git a/.hgsub b/.hgsub
301 301 1 hunks, 1 lines changed
302 302 examine changes to '.hgsub'? [Ynesfdaq?]
303 303 @@ -1,1 +1,2 @@
304 304 sub = sub
305 305 +sub2 = sub2
306 306 record this change to '.hgsub'? [Ynesfdaq?]
307 307 path sub
308 308 source sub
309 309 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
310 310 path sub2
311 311 source sub2
312 312 revision 1f94c7611cc6b74f5a17b16121a1170d44776845
313 313
314 314 $ hg qpop -qa
315 315 patch queue now empty
316 316 $ testrm1 qrecord --config ui.interactive=1 -m2 2.diff <<EOF
317 317 > y
318 318 > y
319 319 > EOF
320 320 adding a
321 321 % update substate when removing .hgsub w/dirty subrepo
322 322 M sub3/a
323 323 R .hgsub
324 324 % qrecord --config ui.interactive=1 -m2 2.diff
325 325 diff --git a/.hgsub b/.hgsub
326 326 deleted file mode 100644
327 327 examine changes to '.hgsub'? [Ynesfdaq?]
328 328 % debugsub should be empty
329 329
330 330 $ hg qpop -qa
331 331 patch queue now empty
332 332 $ testrm2 qrecord --config ui.interactive=1 -m3 3.diff <<EOF
333 333 > y
334 334 > y
335 335 > EOF
336 336 adding a
337 337 % update substate when removing .hgsub w/clean updated subrepo
338 338 R .hgsub
339 339 % qrecord --config ui.interactive=1 -m3 3.diff
340 340 diff --git a/.hgsub b/.hgsub
341 341 deleted file mode 100644
342 342 examine changes to '.hgsub'? [Ynesfdaq?]
343 343 % debugsub should be empty
344 344
345 345 $ cd ..
346 346
347 347
348 348 correctly handle subrepos with patch queues
349 349 $ mkrepo repo-subrepo-with-queue
350 350 $ mksubrepo sub
351 351 adding a
352 352 $ hg -R sub qnew sub0.diff
353 353 $ echo sub = sub >> .hgsub
354 354 $ hg add .hgsub
355 355 $ hg qnew 0.diff
356 356
357 357 $ cd ..
358 358
359 359 check whether MQ operations can import updated .hgsubstate correctly
360 360 both into 'revision' and 'patch file under .hg/patches':
361 361
362 362 $ hg init importing-hgsubstate
363 363 $ cd importing-hgsubstate
364 364
365 365 $ echo a > a
366 366 $ hg commit -u test -d '0 0' -Am '#0 in parent'
367 367 adding a
368 368 $ hg init sub
369 369 $ echo sa > sub/sa
370 370 $ hg -R sub commit -u test -d '0 0' -Am '#0 in sub'
371 371 adding sa
372 372 $ echo 'sub = sub' > .hgsub
373 373 $ touch .hgsubstate
374 374 $ hg add .hgsub .hgsubstate
375 375
376 376 $ hg qnew -u test -d '0 0' import-at-qnew
377 377 $ hg -R sub parents --template '{node} sub\n'
378 378 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
379 379 $ cat .hgsubstate
380 380 b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
381 381 $ hg diff -c tip
382 382 diff -r f499373e340c -r b20ffac88564 .hgsub
383 383 --- /dev/null
384 384 +++ b/.hgsub
385 385 @@ -0,0 +1,1 @@
386 386 +sub = sub
387 387 diff -r f499373e340c -r b20ffac88564 .hgsubstate
388 388 --- /dev/null
389 389 +++ b/.hgsubstate
390 390 @@ -0,0 +1,1 @@
391 391 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
392 392 $ cat .hg/patches/import-at-qnew
393 393 # HG changeset patch
394 394 # Parent f499373e340cdca5d01dee904aeb42dd2a325e71
395 395 # User test
396 396 # Date 0 0
397 397
398 398 diff -r f499373e340c -r b20ffac88564 .hgsub
399 399 --- /dev/null
400 400 +++ b/.hgsub
401 401 @@ -0,0 +1,1 @@
402 402 +sub = sub
403 403 diff -r f499373e340c -r b20ffac88564 .hgsubstate
404 404 --- /dev/null
405 405 +++ b/.hgsubstate
406 406 @@ -0,0 +1,1 @@
407 407 +b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
408 408 $ hg qpop
409 409 popping import-at-qnew
410 410 patch queue now empty
411 411 $ hg qpush
412 412 applying import-at-qnew
413 413 now at: import-at-qnew
414 414
415 415 $ hg qnew import-at-qrefresh
416 416 $ echo sb > sub/sb
417 417 $ hg -R sub commit -u test -d '0 0' -Am '#1 in sub'
418 418 adding sb
419 419 $ hg qrefresh -u test -d '0 0'
420 420 $ hg -R sub parents --template '{node} sub\n'
421 421 88ac1bef5ed43b689d1d200b59886b675dec474b sub
422 422 $ cat .hgsubstate
423 423 88ac1bef5ed43b689d1d200b59886b675dec474b sub
424 424 $ hg diff -c tip
425 425 diff -r 44f846335325 -r b3e8c5fa3aaa .hgsubstate
426 426 --- a/.hgsubstate
427 427 +++ b/.hgsubstate
428 428 @@ -1,1 +1,1 @@
429 429 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
430 430 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
431 431 $ cat .hg/patches/import-at-qrefresh
432 432 # HG changeset patch
433 433 # Date 0 0
434 434 # User test
435 435 # Parent 44f846335325209be6be35dc2c9a4be107278c09
436 436
437 437 diff -r 44f846335325 .hgsubstate
438 438 --- a/.hgsubstate
439 439 +++ b/.hgsubstate
440 440 @@ -1,1 +1,1 @@
441 441 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
442 442 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
443 443
444 444 $ hg qrefresh -u test -d '0 0'
445 445 $ cat .hgsubstate
446 446 88ac1bef5ed43b689d1d200b59886b675dec474b sub
447 447 $ hg diff -c tip
448 448 diff -r 44f846335325 -r b3e8c5fa3aaa .hgsubstate
449 449 --- a/.hgsubstate
450 450 +++ b/.hgsubstate
451 451 @@ -1,1 +1,1 @@
452 452 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
453 453 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
454 454 $ cat .hg/patches/import-at-qrefresh
455 455 # HG changeset patch
456 456 # Date 0 0
457 457 # User test
458 458 # Parent 44f846335325209be6be35dc2c9a4be107278c09
459 459
460 460 diff -r 44f846335325 .hgsubstate
461 461 --- a/.hgsubstate
462 462 +++ b/.hgsubstate
463 463 @@ -1,1 +1,1 @@
464 464 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
465 465 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
466 466
467 467 $ hg update -C tip
468 468 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
469 469 $ hg qpop -a
470 470 popping import-at-qrefresh
471 471 popping import-at-qnew
472 472 patch queue now empty
473 473
474 474 $ hg -R sub update -C 0
475 475 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
476 476 $ echo 'sub = sub' > .hgsub
477 477 $ hg commit -Am '#1 in parent'
478 478 adding .hgsub
479 479 $ hg -R sub update -C 1
480 480 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
481 $ hg commit -Am '#2 in parent (but be rollbacked soon)'
481 $ hg commit -Am '#2 in parent (but will be rolled-back soon)'
482 482 $ hg rollback
483 483 repository tip rolled back to revision 1 (undo commit)
484 484 working directory now based on revision 1
485 485 $ hg status
486 486 M .hgsubstate
487 487 $ hg qnew -u test -d '0 0' checkstate-at-qnew
488 488 $ hg -R sub parents --template '{node} sub\n'
489 489 88ac1bef5ed43b689d1d200b59886b675dec474b sub
490 490 $ cat .hgsubstate
491 491 88ac1bef5ed43b689d1d200b59886b675dec474b sub
492 492 $ hg diff -c tip
493 493 diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
494 494 --- a/.hgsubstate
495 495 +++ b/.hgsubstate
496 496 @@ -1,1 +1,1 @@
497 497 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
498 498 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
499 499 $ cat .hg/patches/checkstate-at-qnew
500 500 # HG changeset patch
501 501 # Parent 4d91eb2fa1d1b22ec513347b9cd06f6b49d470fa
502 502 # User test
503 503 # Date 0 0
504 504
505 505 diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
506 506 --- a/.hgsubstate
507 507 +++ b/.hgsubstate
508 508 @@ -1,1 +1,1 @@
509 509 -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
510 510 +88ac1bef5ed43b689d1d200b59886b675dec474b sub
511 511
512 512 $ cd ..
513 513
514 514 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now