##// END OF EJS Templates
resolve: add a flag for the default behavior of re-merging...
Valentin Gatien-Baron -
r39429:5d00e606 default
parent child Browse files
Show More
@@ -4506,7 +4506,8 b' def rename(ui, repo, *pats, **opts):'
4506 ('l', 'list', None, _('list state of files needing merge')),
4506 ('l', 'list', None, _('list state of files needing merge')),
4507 ('m', 'mark', None, _('mark files as resolved')),
4507 ('m', 'mark', None, _('mark files as resolved')),
4508 ('u', 'unmark', None, _('mark files as unresolved')),
4508 ('u', 'unmark', None, _('mark files as unresolved')),
4509 ('n', 'no-status', None, _('hide status prefix'))]
4509 ('n', 'no-status', None, _('hide status prefix')),
4510 ('', 're-merge', None, _('re-merge files'))]
4510 + mergetoolopts + walkopts + formatteropts,
4511 + mergetoolopts + walkopts + formatteropts,
4511 _('[OPTION]... [FILE]...'),
4512 _('[OPTION]... [FILE]...'),
4512 inferrepo=True)
4513 inferrepo=True)
@@ -4523,9 +4524,9 b' def resolve(ui, repo, *pats, **opts):'
4523
4524
4524 The resolve command can be used in the following ways:
4525 The resolve command can be used in the following ways:
4525
4526
4526 - :hg:`resolve [--tool TOOL] FILE...`: attempt to re-merge the specified
4527 - :hg:`resolve [--re-merge] [--tool TOOL] FILE...`: attempt to re-merge
4527 files, discarding any previous merge attempts. Re-merging is not
4528 the specified files, discarding any previous merge attempts. Re-merging
4528 performed for files already marked as resolved. Use ``--all/-a``
4529 is not performed for files already marked as resolved. Use ``--all/-a``
4529 to select all unresolved files. ``--tool`` can be used to specify
4530 to select all unresolved files. ``--tool`` can be used to specify
4530 the merge tool used for the given files. It overrides the HGMERGE
4531 the merge tool used for the given files. It overrides the HGMERGE
4531 environment variable and your configuration files. Previous file
4532 environment variable and your configuration files. Previous file
@@ -4554,11 +4555,11 b' def resolve(ui, repo, *pats, **opts):'
4554
4555
4555 opts = pycompat.byteskwargs(opts)
4556 opts = pycompat.byteskwargs(opts)
4556 confirm = ui.configbool('commands', 'resolve.confirm')
4557 confirm = ui.configbool('commands', 'resolve.confirm')
4557 flaglist = 'all mark unmark list no_status'.split()
4558 flaglist = 'all mark unmark list no_status re_merge'.split()
4558 all, mark, unmark, show, nostatus = \
4559 all, mark, unmark, show, nostatus, remerge = \
4559 [opts.get(o) for o in flaglist]
4560 [opts.get(o) for o in flaglist]
4560
4561
4561 if len(list(filter(None, [show, mark, unmark]))) > 1:
4562 if len(list(filter(None, [show, mark, unmark, remerge]))) > 1:
4562 raise error.Abort(_("too many options specified"))
4563 raise error.Abort(_("too many options specified"))
4563 if pats and all:
4564 if pats and all:
4564 raise error.Abort(_("can't specify --all and patterns"))
4565 raise error.Abort(_("can't specify --all and patterns"))
@@ -4752,8 +4753,11 b' def resolve(ui, repo, *pats, **opts):'
4752 for f in ms:
4753 for f in ms:
4753 if not m(f):
4754 if not m(f):
4754 continue
4755 continue
4755 flags = ''.join(['-%s ' % o[0:1] for o in flaglist
4756 def flag(o):
4756 if opts.get(o)])
4757 if o == 're_merge':
4758 return '--re-merge '
4759 return '-%s ' % o[0:1]
4760 flags = ''.join([flag(o) for o in flaglist if opts.get(o)])
4757 hint = _("(try: hg resolve %s%s)\n") % (
4761 hint = _("(try: hg resolve %s%s)\n") % (
4758 flags,
4762 flags,
4759 ' '.join(pats))
4763 ' '.join(pats))
@@ -331,7 +331,7 b' Show all commands + options'
331 phase: public, draft, secret, force, rev
331 phase: public, draft, secret, force, rev
332 recover:
332 recover:
333 rename: after, force, include, exclude, dry-run
333 rename: after, force, include, exclude, dry-run
334 resolve: all, list, mark, unmark, no-status, tool, include, exclude, template
334 resolve: all, list, mark, unmark, no-status, re-merge, tool, include, exclude, template
335 revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
335 revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
336 rollback: dry-run, force
336 rollback: dry-run, force
337 root:
337 root:
@@ -442,6 +442,18 b" Test explicitly setting the otion to 'no"
442 $ hg resolve -l
442 $ hg resolve -l
443 R file1
443 R file1
444 R file2
444 R file2
445 Testing the --re-merge flag
446 $ hg resolve --unmark file1
447 $ hg resolve -l
448 U file1
449 R file2
450 $ hg resolve --mark --re-merge
451 abort: too many options specified
452 [255]
453 $ hg resolve --re-merge --all
454 merging file1
455 warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
456 [1]
445
457
446 $ cd ..
458 $ cd ..
447
459
General Comments 0
You need to be logged in to leave comments. Login now