diff mercurial/cmdutil.py @ 35853:eeb87b24aea7 stable

amend: abort if unresolved merge conflicts found (issue5805) It was checked by repo.commit() before e8a7c1a0565a "cmdutil: remove the redundant commit during amend."
author Yuya Nishihara <yuya@tcha.org>
date Sun, 11 Mar 2018 20:10:38 +0900
parents e5b6ba786d83
children c479692690ef
line wrap: on
line diff
--- 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)