Commit 9523590e authored by Anton Shestakov's avatar Anton Shestakov
Browse files

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.

--HG--
branch : stable
parent f3870eecf859
Pipeline #12133 passed with stage
in 5 minutes and 9 seconds
......@@ -651,6 +651,7 @@ def _completecontentdivergent(ui, repo, progresscb, divergent, other,
# 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):
......
......@@ -509,6 +509,7 @@ Testing when different parent, merging conflict:
$ 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 @@ Testing when different parent, conflict in relocation and merging:
$ hg par
changeset: 5:e800202333a4
tag: tip
parent: 2:155349b645be
user: test
date: Thu Jan 01 00:00:00 1970 +0000
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment