# HG changeset patch # User Boris Feld # Date 1508923624 -7200 # Node ID ef475fce0dd24d6668a2f3a388765652b62af225 # Parent 577bfc34e19b2b3b0d34e07d1fe5bd95df866d78 test: add a test to reproduce issue 5720 diff -r 577bfc34e19b -r ef475fce0dd2 tests/test-issue-5720.t --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-issue-5720.t Wed Oct 25 11:27:04 2017 +0200 @@ -0,0 +1,87 @@ +This test file test the #5720 issue + +Check that `hg evolve --continue` doesn't change changeset phase from secret +to draft after a merge conflict. + +https://bz.mercurial-scm.org/show_bug.cgi?id=5720 + +Global setup +============ + + $ . $TESTDIR/testlib/common.sh + $ cat >> $HGRCPATH < [ui] + > interactive = true + > [phases] + > publish=False + > [extensions] + > evolve = + > EOF + +Test +==== + + $ hg init $TESTTMP/issue-5720 + $ cd $TESTTMP/issue-5720 + +Create two drafts commits and one secret + $ echo a > a + $ hg commit -Am a + adding a + $ echo b > a + $ hg commit -m b + $ echo c > a + $ hg commit --secret -m c + $ hg log -G -T "{rev}: {phase}" + @ 2: secret + | + o 1: draft + | + o 0: draft + +Amend the second draft with new content + $ hg prev + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + [1] b + $ echo b2 > a + $ hg amend + 1 new orphan changesets + $ hg log -G -T "{rev}: {phase}" + @ 3: draft + | + | * 2: secret + | | + | x 1: draft + |/ + o 0: draft + +Evolve which triggers a conflict + $ hg evolve + move:[2] c + atop:[3] b + merging a + warning: conflicts while merging a! (edit, then use 'hg resolve --mark') + evolve failed! + fix conflict and run 'hg evolve --continue' or use 'hg update -C .' to abort + abort: unresolved merge conflicts (see hg help resolve) + [255] + +Fix the conflict + $ echo c2 > a + $ hg resolve -m + (no more unresolved files) + +Continue the evolution + $ hg evolve --continue + grafting 2:13833940840c "c" + +Tip should stay in secret phase + $ hg log -G -T "{rev}: {phase}" + @ 4: draft + | + o 3: draft + | + o 0: draft + + $ hg log -r . -T '{phase}\n' + draft