comparison tests/test-mq-qrefresh.t @ 13035:f08df4d38442 stable

mq: ignore subrepos (issue2499) If MQ allows modifying .hgsub or .hgsubstate in a patch, it can easily lead to an inconsistent subrepo state. This patch prevents qrefresh from adding any modifications to .hgsub or .hgsubstate to a patch. The user is warned that these files are not included in the patch. The tests test both the slightly irrational and the pathological cases.
author Kevin Bullock <kbullock@ringworld.org>
date Tue, 16 Nov 2010 13:06:07 -0600
parents 4fee1fd3de9a
children 487b5787fe01
comparison
equal deleted inserted replaced
13025:99210fb3bc0a 13035:f08df4d38442
485 @@ -0,0 +1,1 @@ 485 @@ -0,0 +1,1 @@
486 +a 486 +a
487 487
488 $ cd .. 488 $ cd ..
489 489
490
491 Issue2499: refuse to add .hgsub{,state} to a patch
492
493 $ hg init repo-2499
494 $ cd repo-2499
495 $ hg qinit
496 $ hg qnew -m 0 0.diff
497 $ echo a > a
498 $ hg init sub
499 $ cd sub
500 $ echo b > b
501 $ hg ci -Am 0sub
502 adding b
503 $ cd ..
504
505 test when adding
506 $ echo sub = sub > .hgsub
507 $ echo `hg id -i --debug sub` sub > .hgsubstate
508 $ hg add
509 adding .hgsub
510 adding .hgsubstate
511 adding a
512 $ hg qrefresh
513 warning: not adding .hgsub
514 warning: not adding .hgsubstate
515 $ hg qfinish -a
516 $ hg status
517 A .hgsub
518 A .hgsubstate
519 $ hg forget .hgsubstate
520 $ rm .hgsubstate
521
522 add subrepo with a real commit
523 $ hg ci -m 1
524 committing subrepository sub
525 $ hg qnew -m 2 2.diff
526
527 test when modifying
528 $ echo sub2 = sub2 >> .hgsub
529 $ hg qrefresh
530 warning: not refreshing .hgsub
531 $ echo 0000000000000000000000000000000000000000 sub2 >> .hgsubstate
532 $ hg qrefresh
533 warning: not refreshing .hgsub
534 warning: not refreshing .hgsubstate
535 $ hg revert --no-backup .hgsub .hgsubstate
536
537 test when removing
538 $ hg rm .hgsub
539 $ hg rm .hgsubstate
540 $ hg qrefresh
541 warning: not removing .hgsub
542 warning: not removing .hgsubstate
543 $ hg status
544 R .hgsub
545 R .hgsubstate
546 $ hg revert --no-backup .hgsub .hgsubstate
547
548 test when deleting
549 $ rm .hgsub .hgsubstate
550 $ hg qrefresh
551 warning: not removing .hgsub
552 warning: not removing .hgsubstate
553 refresh interrupted while patch was popped! (revert --all, qpush to recover)
554 abort: No such file or directory: $TESTTMP/repo-2499/.hgsub
555 [255]
556 $ hg status
557 ! .hgsub
558 ! .hgsubstate
559 $ hg cat -r1 .hgsub > .hgsub
560 $ hg revert --no-backup .hgsubstate
561
562 $ cd ..