pick: add --tool for hg pick to specify mergetool
authorSangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
Sun, 03 Feb 2019 17:03:02 +0530
changeset 4391 054ff759f2fd
parent 4390 312b9e8a4c9c
child 4392 c09889f81947
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.
CHANGELOG
hgext3rd/evolve/cmdrewrite.py
tests/test-grab.t
--- 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)