Mercurial > hg
comparison tests/test-split.t @ 38424:4f885770c4a2
split: preserve phase of commit that is being split
With this change, hg split will preserve the phase of the commit that is being
split, ignoring the phases.new-commit setting. Previously, we would use whatever
phases.new-commit was set to (unless our parent was secret, then we would be
secret even if phases.new-commit=draft).
Now, splitting a draft commit with phases.new-commit=secret does not cause the
new commits to become secret, and splitting a secret commit with
phases.new-commit=draft and a draft parent does not cause the new commits to
become draft.
Test cases and commit message taken from Kyle Lippincott's D2016 (thanks!).
Differential Revision: https://phab.mercurial-scm.org/D3819
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 19 Jun 2018 13:49:06 -0700 |
parents | a0e185f10454 |
children | 5abc47d4ca6b |
comparison
equal
deleted
inserted
replaced
38423:32fba6fe893d | 38424:4f885770c4a2 |
---|---|
530 | x 1:112478962961 B | 530 | x 1:112478962961 B |
531 |/ | 531 |/ |
532 o 0:426bada5c675 A | 532 o 0:426bada5c675 A |
533 | 533 |
534 #endif | 534 #endif |
535 | |
536 Preserve secret phase in split | |
537 | |
538 $ cp -R $TESTTMP/clean $TESTTMP/phases1 | |
539 $ cd $TESTTMP/phases1 | |
540 $ hg phase --secret -fr tip | |
541 $ hg log -T '{short(node)} {phase}\n' | |
542 1df0d5c5a3ab secret | |
543 a61bcde8c529 draft | |
544 $ runsplit tip >/dev/null | |
545 $ hg log -T '{short(node)} {phase}\n' | |
546 00eebaf8d2e2 secret | |
547 a09ad58faae3 secret | |
548 e704349bd21b secret | |
549 a61bcde8c529 draft | |
550 | |
551 Do not move things to secret even if phases.new-commit=secret | |
552 | |
553 $ cp -R $TESTTMP/clean $TESTTMP/phases2 | |
554 $ cd $TESTTMP/phases2 | |
555 $ cat >> .hg/hgrc <<EOF | |
556 > [phases] | |
557 > new-commit=secret | |
558 > EOF | |
559 $ hg log -T '{short(node)} {phase}\n' | |
560 1df0d5c5a3ab draft | |
561 a61bcde8c529 draft | |
562 $ runsplit tip >/dev/null | |
563 $ hg log -T '{short(node)} {phase}\n' | |
564 00eebaf8d2e2 draft | |
565 a09ad58faae3 draft | |
566 e704349bd21b draft | |
567 a61bcde8c529 draft |