Mercurial > hg
changeset 26741:e1568d5eb052
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.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Wed, 14 Oct 2015 16:04:43 -0700 |
parents | f4a27c05c43f |
children | bec1a579ebc4 |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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)