# HG changeset patch # User Anton Shestakov # Date 1566991858 -25200 # Node ID 0852dcba82f6e863298a8e55a2613e5092743ebf # Parent 4c5377ab147ab31d64505840b1f1e2cc7e3ec366 tests: demonstrate that fold doesn't care about allowdivergence config option diff -r 4c5377ab147a -r 0852dcba82f6 tests/test-fold.t --- a/tests/test-fold.t Fri Sep 06 13:23:25 2019 +0700 +++ b/tests/test-fold.t Wed Aug 28 18:30:58 2019 +0700 @@ -381,3 +381,35 @@ o 0: r0 $ cd .. + +Fold should respect experimental.evolution.allowdivergence option +https://bz.mercurial-scm.org/show_bug.cgi?id=5817 + + $ hg init issue5817 + $ cd issue5817 + + $ echo A > foo + $ hg ci -qAm A + $ echo B > foo + $ hg ci -m B + $ echo C > foo + $ hg ci -m C + + $ hg fold --exact -r 'desc("A")::desc("B")' -m 'first fold' + 1 new orphan changesets + 2 changesets folded + +FIXME: fold should abort here because divergence is not allowed + + $ hg fold --exact -r 'desc("A")::desc("B")' -m 'second fold' \ + > --config experimental.evolution.allowdivergence=no + 2 new content-divergent changesets + 2 changesets folded + +but if we allow divergence, this should work and should create new content-divergent changesets + + $ hg fold --exact -r 'desc("A")::desc("B")' -m 'second fold' \ + > --config experimental.evolution.allowdivergence=yes + 2 changesets folded + + $ cd ..