tests/test-evolve-content-divergent-relocation.t
changeset 5342 265e029785ae
parent 5341 13376ca93fa3
child 5343 ebfd0d875600
--- a/tests/test-evolve-content-divergent-relocation.t	Thu Apr 30 10:05:14 2020 -0700
+++ b/tests/test-evolve-content-divergent-relocation.t	Mon Dec 09 10:05:24 2019 -0800
@@ -600,3 +600,59 @@
   
 
   $ cd ..
+
+Testing when relocation results in nothing to commit
+----------------------------------------------------
+
+Set up a repo where relocation results in no changes to commit because the
+changes from the relocated node are already in the destination.
+
+  $ hg init nothing-to-commit
+  $ cd nothing-to-commit
+  $ echo 0 > a
+  $ hg ci -Aqm initial
+  $ echo 1 > a
+  $ hg ci -Aqm upstream
+  $ hg prev -q
+
+Create the source of divergence.
+  $ echo 0 > b
+  $ hg ci -Aqm divergent
+
+The first side of the divergence get rebased on top of upstream.
+  $ hg rebase -r . -d 'desc("upstream")'
+  rebasing 2:898ddd4443b3 "divergent" (tip)
+  $ hg --hidden co 2 -q
+  updated to hidden changeset 898ddd4443b3
+  (hidden revision '898ddd4443b3' was rewritten as: befae6138569)
+  working directory parent is obsolete! (898ddd4443b3)
+
+The other side of the divergence gets amended so it matches upstream.
+Relocation (onto upstream) will therefore result in no changes to commit.
+  $ hg revert -r 'desc("upstream")' --all
+  removing b
+  reverting a
+  $ hg amend --config experimental.evolution.allowdivergence=True
+  2 new content-divergent changesets
+
+Add a commit on top. This one should become an orphan. Evolving it later
+should put it on top of the other divergent side (the one that's on top of
+upstream)
+  $ echo 0 > c
+  $ hg ci -Aqm child
+  $ hg co -q null
+  $ hg glog
+  o  5:88473f9137d1 child
+  |   () [default] draft
+  *  4:4cc21313ecee divergent
+  |   () [default] draft
+  | *  3:befae6138569 divergent
+  | |   () [default] draft
+  | o  1:33c576d20069 upstream
+  |/    () [default] draft
+  o  0:98a3f8f02ba7 initial
+      () [default] draft
+  $ hg evolve --content-divergent 2>&1 | grep TypeError
+  TypeError: expected *, NoneType found (glob)
+
+  $ cd ..