comparison mercurial/commands.py @ 38859:db03e5cefc82

resolve: support commands.resolve.confirm option with --mark flag Now, commands.resolve.confirm config option also respect --mark; and confirm to mark all 'unresolved' files as 'resolved'. It will confirm only when you don't pass any pats i.e 'hg resolve -m', because when no file pats are passed then --mark's default functionality is to mark all unresolved files. And if user has given file pats then I think there is no need to confirm. Differential Revision: https://phab.mercurial-scm.org/D4101
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Sat, 04 Aug 2018 12:23:18 +0530
parents 96d0795bd0bd
children 7e75777e4a51
comparison
equal deleted inserted replaced
38858:e9740c07158d 38859:db03e5cefc82
4544 if pats and all: 4544 if pats and all:
4545 raise error.Abort(_("can't specify --all and patterns")) 4545 raise error.Abort(_("can't specify --all and patterns"))
4546 if not (all or pats or show or mark or unmark): 4546 if not (all or pats or show or mark or unmark):
4547 raise error.Abort(_('no files or directories specified'), 4547 raise error.Abort(_('no files or directories specified'),
4548 hint=('use --all to re-merge all unresolved files')) 4548 hint=('use --all to re-merge all unresolved files'))
4549 if mark and confirm and not pats:
4550 if ui.promptchoice(_(b'mark all unresolved files as resolved (yn)?'
4551 b'$$ &Yes $$ &No')):
4552 raise error.Abort(_('user quit'))
4549 4553
4550 if show: 4554 if show:
4551 ui.pager('resolve') 4555 ui.pager('resolve')
4552 fm = ui.formatter('resolve', opts) 4556 fm = ui.formatter('resolve', opts)
4553 ms = mergemod.mergestate.read(repo) 4557 ms = mergemod.mergestate.read(repo)