diff tests/test-touch.t @ 4728:ef8907df73fc stable

touch: fix the inconsistent behavior of divergence catching logic (issue6107) When touching a node, the way we check if it can lead to divergence is we look at the successors sets of the rev being touched. And if there is successor revs exists (excluding the case when that successor set is (A,) for rev A) that means there will be divergence and we warn the user. This works fine but there is still a case (which is not covered by looking at successor sets) which can lead to divergence. That case is: when there is already a revision exists which is divergent to the revision being touched. And performing the touch would revive that "dead" divergence. (Dead because one of the revision is obsolete which is the one we are touching) And to see if there is any rev which is divergent to a particular rev we already have a function which we can use here i.e. `evolvecmd.divergentsets(repo, ctx_being_touched)` Changes in test file demonstrate the fixed behaviour.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Wed, 17 Jul 2019 17:58:44 +0200
parents 355b8e17e14c
children 076b6813a7ea c6fc1000af1e
line wrap: on
line diff
--- a/tests/test-touch.t	Sat Jun 29 14:28:35 2019 +0530
+++ b/tests/test-touch.t	Wed Jul 17 17:58:44 2019 +0200
@@ -186,7 +186,9 @@
 
   $ hg touch -r "desc('added c')" --hidden
   $ hg touch -r "desc('modified c')" --hidden
+  [1] modified c
+  reviving this changeset will create divergence unless you make a duplicate.
+  (a)llow divergence or (d)uplicate the changeset?  a
   2 new content-divergent changesets
-XXX: it should warn for divergence here
 
   $ cd ..