##// END OF EJS Templates
mq: ignore subrepos (issue2499)...
Kevin Bullock -
r13035:f08df4d3 stable
parent child Browse files
Show More
@@ -1295,12 +1295,18 b' class queue(object):'
1295 # local dirstate. in this case, we want them to only
1295 # local dirstate. in this case, we want them to only
1296 # show up in the added section
1296 # show up in the added section
1297 for x in m:
1297 for x in m:
1298 if x == '.hgsub' or x == '.hgsubstate':
1299 self.ui.warn(_('warning: not refreshing %s\n') % x)
1300 continue
1298 if x not in aa:
1301 if x not in aa:
1299 mm.append(x)
1302 mm.append(x)
1300 # we might end up with files added by the local dirstate that
1303 # we might end up with files added by the local dirstate that
1301 # were deleted by the patch. In this case, they should only
1304 # were deleted by the patch. In this case, they should only
1302 # show up in the changed section.
1305 # show up in the changed section.
1303 for x in a:
1306 for x in a:
1307 if x == '.hgsub' or x == '.hgsubstate':
1308 self.ui.warn(_('warning: not adding %s\n') % x)
1309 continue
1304 if x in dd:
1310 if x in dd:
1305 del dd[dd.index(x)]
1311 del dd[dd.index(x)]
1306 mm.append(x)
1312 mm.append(x)
@@ -1310,6 +1316,9 b' class queue(object):'
1310 # are not in the add or change column of the patch
1316 # are not in the add or change column of the patch
1311 forget = []
1317 forget = []
1312 for x in d + r:
1318 for x in d + r:
1319 if x == '.hgsub' or x == '.hgsubstate':
1320 self.ui.warn(_('warning: not removing %s\n') % x)
1321 continue
1313 if x in aa:
1322 if x in aa:
1314 del aa[aa.index(x)]
1323 del aa[aa.index(x)]
1315 forget.append(x)
1324 forget.append(x)
@@ -487,3 +487,76 b' Issue1441 with git patches:'
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 ..
General Comments 0
You need to be logged in to leave comments. Login now