pick: reduce configoverride() scope
Merge tool is only needed for merge.graft() (it's what graft in core hg does),
so let's make the scope of the ui.configoverride() narrower.
--- a/hgext3rd/evolve/cmdrewrite.py Sat Jun 08 16:09:37 2019 +0800
+++ b/hgext3rd/evolve/cmdrewrite.py Sat Jun 08 16:57:34 2019 +0800
@@ -1430,8 +1430,7 @@
if opts.get('rev'):
revs.append(opts['rev'])
- overrides = {('ui', 'forcemerge'): opts.get('tool', '')}
- with repo.wlock(), repo.lock(), repo.transaction('pick'), ui.configoverride(overrides, 'pick'):
+ with repo.wlock(), repo.lock(), repo.transaction('pick'):
pickstate = state.cmdstate(repo, path='pickstate')
pctx = repo['.']
@@ -1453,8 +1452,10 @@
ui.status(_('picking %d:%s "%s"\n') %
(origctx.rev(), origctx,
origctx.description().split("\n", 1)[0]))
- stats = merge.graft(repo, origctx, origctx.p1(), ['local',
- 'destination'])
+ overrides = {('ui', 'forcemerge'): opts.get('tool', '')}
+ with ui.configoverride(overrides, 'pick'):
+ stats = merge.graft(repo, origctx, origctx.p1(),
+ ['local', 'destination'])
if compat.hasconflict(stats):
pickstate.addopts({'orignode': origctx.node(),
'oldpctx': pctx.node()})