--- a/mercurial/cmdutil.py Tue Mar 06 13:19:54 2018 -0600
+++ b/mercurial/cmdutil.py Sun Mar 11 20:10:38 2018 +0900
@@ -34,6 +34,7 @@
graphmod,
match as matchmod,
mdiff,
+ mergeutil,
obsolete,
patch,
pathutil,
@@ -3212,6 +3213,11 @@
if subs:
subrepo.writestate(repo, newsubstate)
+ # avoid cycle (TODO: should be removed in default branch)
+ from . import merge as mergemod
+ ms = mergemod.mergestate.read(repo)
+ mergeutil.checkunresolved(ms)
+
filestoamend = set(f for f in wctx.files() if matcher(f))
changes = (len(filestoamend) > 0)