diff mercurial/cmdutil.py @ 30286:3d38a0bc774f

cmdutil: refactor checkunresolved localrepo.commit had code to check for unresolved merge conflicts, it would be helpful for at least rebase to be able to use that code without calling commit().
author timeless <timeless@mozdev.org>
date Wed, 02 Nov 2016 18:45:53 +0000
parents 144d8fe266d9
children 318a24b52eeb
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Wed Nov 02 18:56:07 2016 +0000
+++ b/mercurial/cmdutil.py	Wed Nov 02 18:45:53 2016 +0000
@@ -3403,6 +3403,14 @@
 
     return cmd
 
+def checkunresolved(ms):
+    if list(ms.unresolved()):
+        raise error.Abort(_("unresolved merge conflicts "
+                            "(see 'hg help resolve')"))
+    if ms.mdstate() != 's' or list(ms.driverresolved()):
+        raise error.Abort(_('driver-resolved merge conflicts'),
+                          hint=_('run "hg resolve --all" to resolve'))
+
 # a list of (ui, repo, otherpeer, opts, missing) functions called by
 # commands.outgoing.  "missing" is "missing" of the result of
 # "findcommonoutgoing()"