localrepo.commit: disallow commit when driver-resolved files exist
This code will not currently be activated because there's no code to mark
files as driver-resolved in core. This point is also somewhat hard to plug into
from extensions.
--- a/mercurial/localrepo.py Wed Oct 14 15:01:07 2015 -0700
+++ b/mercurial/localrepo.py Wed Oct 14 16:04:43 2015 -0700
@@ -1553,11 +1553,21 @@
if merge and cctx.deleted():
raise error.Abort(_("cannot commit merge with missing files"))
+ unresolved, driverresolved = False, False
ms = mergemod.mergestate(self)
for f in status.modified:
- if f in ms and ms[f] == 'u':
- raise error.Abort(_('unresolved merge conflicts '
- '(see "hg help resolve")'))
+ if f in ms:
+ if ms[f] == 'u':
+ unresolved = True
+ elif ms[f] == 'd':
+ driverresolved = True
+
+ if unresolved:
+ raise error.Abort(_('unresolved merge conflicts '
+ '(see "hg help resolve")'))
+ if driverresolved:
+ raise error.Abort(_('driver-resolved merge conflicts'),
+ hint=_('run "hg resolve --all" to resolve'))
if editor:
cctx._text = editor(self, cctx, subs)