changeset 4831:0852dcba82f6 stable

tests: demonstrate that fold doesn't care about allowdivergence config option
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 28 Aug 2019 18:30:58 +0700
parents 4c5377ab147a
children 8a491546e81d
files tests/test-fold.t
diffstat 1 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 ..