Mercurial > evolve
changeset 4391:054ff759f2fd
pick: add --tool for hg pick to specify mergetool
This patch used configuration override to enable you to pass a mergetool via the
--tool flag in case there is any merge conflict.
author | Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com> |
---|---|
date | Sun, 03 Feb 2019 17:03:02 +0530 |
parents | 312b9e8a4c9c |
children | c09889f81947 |
files | CHANGELOG hgext3rd/evolve/cmdrewrite.py tests/test-grab.t |
diffstat | 3 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGELOG Wed Feb 06 13:49:29 2019 +0800 +++ b/CHANGELOG Sun Feb 03 17:03:02 2019 +0530 @@ -6,6 +6,7 @@ * evolve: improved support for content-divergence with public changesets * stack: support ranges in revsets indexing + * pick: add the standard `--tool` option 8.4.0 -- 2019-12-22 -------------------
--- a/hgext3rd/evolve/cmdrewrite.py Wed Feb 06 13:49:29 2019 +0800 +++ b/hgext3rd/evolve/cmdrewrite.py Sun Feb 03 17:03:02 2019 +0530 @@ -1387,7 +1387,7 @@ [('r', 'rev', '', _('revision to pick'), _('REV')), ('c', 'continue', False, 'continue interrupted pick'), ('a', 'abort', False, 'abort interrupted pick'), - ], + ] + mergetoolopts, _('[-r] rev')) def cmdpick(ui, repo, *revs, **opts): """move a commit on the top of working directory parent and updates to it.""" @@ -1402,7 +1402,8 @@ if opts.get('rev'): revs.append(opts['rev']) - with repo.wlock(), repo.lock(), repo.transaction('pick'): + overrides = {('ui', 'forcemerge'): opts.get('tool', '')} + with repo.wlock(), repo.lock(), repo.transaction('pick'), ui.configoverride(overrides, 'pick'): pickstate = state.cmdstate(repo, path='pickstate') pctx = repo['.']
--- a/tests/test-grab.t Wed Feb 06 13:49:29 2019 +0800 +++ b/tests/test-grab.t Sun Feb 03 17:03:02 2019 +0530 @@ -24,9 +24,10 @@ options: - -r --rev REV revision to pick - -c --continue continue interrupted pick - -a --abort abort interrupted pick + -r --rev REV revision to pick + -c --continue continue interrupted pick + -a --abort abort interrupted pick + -t --tool TOOL specify merge tool (some details hidden, use --verbose to show complete help)