Mercurial > evolve
view tests/test-evolve-issue5967.t @ 5619:5673730db8d5 stable
evolve: clean merge state when content divergence resolution has no changes
This patch backs out b723805d7fe1, which only hid the problem.
Usually mergestate is cleared (or should be cleared) when creating a new
changeset, but sometimes there are situations when there's nothing to commit.
When solving content divergence resulted in no changes and no new changesets
were created, mergestate was left untouched. That's a problem because sometimes
mergestate contains files with conflicts that were already resolved by user,
and such mergestate only applies to the current wdir parent. Since evolve has
already dealt with the current wdir parent successfully when it reached this
code, this is a good place to clean the mergestate.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 19 Sep 2020 17:49:31 +0200 |
parents | e8660b28bfee |
children | e5d91fd1f319 6eb9f82b43ba |
line wrap: on
line source
hg evolve --continue and obsmarkers after conflict resolution with no changes to commit (issue5967) https://bz.mercurial-scm.org/show_bug.cgi?id=5967 $ . $TESTDIR/testlib/common.sh $ hg init issue5967 $ cd issue5967 $ cat > .hg/hgrc << EOF > [alias] > glog = log -GT "{rev}: {desc}" > [extensions] > evolve= > EOF $ echo apple > a $ hg ci -qAm 'apple' $ echo banana > a $ hg ci -m 'banana' Amending revision 0 in a way that causes conflicts $ hg prev 1 files updated, 0 files merged, 0 files removed, 0 files unresolved [0] apple $ echo apricot > a $ hg amend -m 'apricot' 1 new orphan changesets $ hg glog @ 2: apricot * 1: banana | x 0: apple Trying to evolve, then manually discarding changes from revision 1 $ hg evolve move:[1] banana atop:[2] apricot merging a warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved merge conflicts (see 'hg help evolve.interrupted') [1] $ echo apricot > a $ hg resolve --mark a (no more unresolved files) continue: hg evolve --continue This will correctly notice that revision 1 can be dropped $ hg evolve --continue evolving 1:dd9b5dd30cd6 "banana" evolution of 1:dd9b5dd30cd6 created no changes to commit working directory is now at 4d6fec23dcc4 $ hg glog @ 2: apricot This is important: 1 should not have a successor (especially not revision 2) $ hg debugobsolete 3ba7db0ce860a189d1fd1fd7675f0e871652ed16 4d6fec23dcc4c3e4ccce8b1d3b79f62ee927c2be 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'amend', 'user': 'test'} dd9b5dd30cd6b703d126d55b34165fd6ec5717c9 0 {3ba7db0ce860a189d1fd1fd7675f0e871652ed16} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'} $ hg olog --all @ 4d6fec23dcc4 (2) apricot | rewritten(description, content) from 3ba7db0ce860 using amend by test (Thu Jan 01 00:00:00 1970 +0000) | x 3ba7db0ce860 (0) apple $ hg olog --hidden --all 1 x dd9b5dd30cd6 (1) banana pruned using evolve by test (Thu Jan 01 00:00:00 1970 +0000)