Mercurial > hg
comparison mercurial/localrepo.py @ 27102:f97bb61b51e6 stable
localrepo.commit: check all files for resolve state (issue4972)
Previously we were only checking modified files for their resolve state. But a
file might be unresolved yet not in the modified state. Handle all such cases
properly.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Mon, 30 Nov 2015 16:31:28 -0800 |
parents | 0a7610758c42 |
children | 42aa0e570eaa |
comparison
equal
deleted
inserted
replaced
26960:6979fe2a6d75 | 27102:f97bb61b51e6 |
---|---|
1554 return None | 1554 return None |
1555 | 1555 |
1556 if merge and cctx.deleted(): | 1556 if merge and cctx.deleted(): |
1557 raise error.Abort(_("cannot commit merge with missing files")) | 1557 raise error.Abort(_("cannot commit merge with missing files")) |
1558 | 1558 |
1559 unresolved, driverresolved = False, False | |
1560 ms = mergemod.mergestate(self) | 1559 ms = mergemod.mergestate(self) |
1561 for f in status.modified: | 1560 |
1562 if f in ms: | 1561 if list(ms.unresolved()): |
1563 if ms[f] == 'u': | |
1564 unresolved = True | |
1565 elif ms[f] == 'd': | |
1566 driverresolved = True | |
1567 | |
1568 if unresolved: | |
1569 raise error.Abort(_('unresolved merge conflicts ' | 1562 raise error.Abort(_('unresolved merge conflicts ' |
1570 '(see "hg help resolve")')) | 1563 '(see "hg help resolve")')) |
1571 if driverresolved or ms.mdstate() != 's': | 1564 if ms.mdstate() != 's' or list(ms.driverresolved()): |
1572 raise error.Abort(_('driver-resolved merge conflicts'), | 1565 raise error.Abort(_('driver-resolved merge conflicts'), |
1573 hint=_('run "hg resolve --all" to resolve')) | 1566 hint=_('run "hg resolve --all" to resolve')) |
1574 | 1567 |
1575 if editor: | 1568 if editor: |
1576 cctx._text = editor(self, cctx, subs) | 1569 cctx._text = editor(self, cctx, subs) |