mercurial/commands.py
changeset 41759 aaad36b88298
parent 41748 980e05204ed8
child 41781 e9b9ee9af4a9
equal deleted inserted replaced
41758:15d3facfa40a 41759:aaad36b88298
  1674         extra['close'] = '1'
  1674         extra['close'] = '1'
  1675 
  1675 
  1676         if not bheads:
  1676         if not bheads:
  1677             raise error.Abort(_('can only close branch heads'))
  1677             raise error.Abort(_('can only close branch heads'))
  1678         elif opts.get('amend'):
  1678         elif opts.get('amend'):
  1679             if repo['.'].p1().branch() != branch and \
  1679             if (repo['.'].p1().branch() != branch and
  1680                     repo['.'].p2().branch() != branch:
  1680                 repo['.'].p2().branch() != branch):
  1681                 raise error.Abort(_('can only close branch heads'))
  1681                 raise error.Abort(_('can only close branch heads'))
  1682 
  1682 
  1683     if opts.get('amend'):
  1683     if opts.get('amend'):
  1684         if ui.configbool('ui', 'commitsubrepos'):
  1684         if ui.configbool('ui', 'commitsubrepos'):
  1685             raise error.Abort(_('cannot amend with ui.commitsubrepos enabled'))
  1685             raise error.Abort(_('cannot amend with ui.commitsubrepos enabled'))
  4820     """
  4820     """
  4821 
  4821 
  4822     opts = pycompat.byteskwargs(opts)
  4822     opts = pycompat.byteskwargs(opts)
  4823     confirm = ui.configbool('commands', 'resolve.confirm')
  4823     confirm = ui.configbool('commands', 'resolve.confirm')
  4824     flaglist = 'all mark unmark list no_status re_merge'.split()
  4824     flaglist = 'all mark unmark list no_status re_merge'.split()
  4825     all, mark, unmark, show, nostatus, remerge = \
  4825     all, mark, unmark, show, nostatus, remerge = [
  4826         [opts.get(o) for o in flaglist]
  4826         opts.get(o) for o in flaglist]
  4827 
  4827 
  4828     actioncount = len(list(filter(None, [show, mark, unmark, remerge])))
  4828     actioncount = len(list(filter(None, [show, mark, unmark, remerge])))
  4829     if actioncount > 1:
  4829     if actioncount > 1:
  4830         raise error.Abort(_("too many actions specified"))
  4830         raise error.Abort(_("too many actions specified"))
  4831     elif (actioncount == 0
  4831     elif (actioncount == 0
  4950                 continue
  4950                 continue
  4951 
  4951 
  4952             if mark:
  4952             if mark:
  4953                 if markcheck:
  4953                 if markcheck:
  4954                     fdata = repo.wvfs.tryread(f)
  4954                     fdata = repo.wvfs.tryread(f)
  4955                     if filemerge.hasconflictmarkers(fdata) and \
  4955                     if (filemerge.hasconflictmarkers(fdata) and
  4956                         ms[f] != mergemod.MERGE_RECORD_RESOLVED:
  4956                         ms[f] != mergemod.MERGE_RECORD_RESOLVED):
  4957                         hasconflictmarkers.append(f)
  4957                         hasconflictmarkers.append(f)
  4958                 ms.mark(f, mergemod.MERGE_RECORD_RESOLVED)
  4958                 ms.mark(f, mergemod.MERGE_RECORD_RESOLVED)
  4959             elif unmark:
  4959             elif unmark:
  4960                 ms.mark(f, mergemod.MERGE_RECORD_UNRESOLVED)
  4960                 ms.mark(f, mergemod.MERGE_RECORD_UNRESOLVED)
  4961             else:
  4961             else: