diff -r a82fc3922446 -r c479692690ef mercurial/cmdutil.py --- a/mercurial/cmdutil.py Fri Mar 16 12:10:15 2018 -0700 +++ b/mercurial/cmdutil.py Sat Mar 17 21:46:17 2018 -0400 @@ -32,6 +32,7 @@ logcmdutil, match as matchmod, merge as mergemod, + mergeutil, obsolete, patch, pathutil, @@ -2357,6 +2358,11 @@ if subs: subrepoutil.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)