changeset 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 f3870eecf859
children eb326644dc29 71cc223fd109
files hgext3rd/evolve/evolvecmd.py tests/test-evolve-public-content-divergent-discard.t
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Fri May 08 19:49:07 2020 +0800
+++ b/hgext3rd/evolve/evolvecmd.py	Sat Sep 19 17:49:31 2020 +0200
@@ -651,6 +651,7 @@
             # no changes, create markers to resolve divergence
             obsolete.createmarkers(repo, [(otherdiv, (publicdiv,))],
                                    operation=b'evolve')
+            compat.mergestate.clean(repo)
             return (True, publicnode)
 
     with repo.dirstate.parentchange(), compat.parentchange(repo):
--- a/tests/test-evolve-public-content-divergent-discard.t	Fri May 08 19:49:07 2020 +0800
+++ b/tests/test-evolve-public-content-divergent-discard.t	Sat Sep 19 17:49:31 2020 +0200
@@ -509,6 +509,7 @@
 
   $ hg par
   changeset:   5:e800202333a4
+  tag:         tip
   parent:      2:155349b645be
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
@@ -626,6 +627,7 @@
 
   $ hg par
   changeset:   5:e800202333a4
+  tag:         tip
   parent:      2:155349b645be
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000