comparison 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
comparison
equal deleted inserted replaced
4727:355b8e17e14c 4728:ef8907df73fc
184 $ hg amend -m "modified c" 184 $ hg amend -m "modified c"
185 $ hg prune . -q 185 $ hg prune . -q
186 186
187 $ hg touch -r "desc('added c')" --hidden 187 $ hg touch -r "desc('added c')" --hidden
188 $ hg touch -r "desc('modified c')" --hidden 188 $ hg touch -r "desc('modified c')" --hidden
189 [1] modified c
190 reviving this changeset will create divergence unless you make a duplicate.
191 (a)llow divergence or (d)uplicate the changeset? a
189 2 new content-divergent changesets 192 2 new content-divergent changesets
190 XXX: it should warn for divergence here
191 193
192 $ cd .. 194 $ cd ..