# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 2019-04-16 17:12:21 # Node ID 9e40c58927143f92d0c180608bed905cc31f4f6e # Parent 4f9a89837f074ed590aefbafe204cfd3983316d4 chistedit: use context manager to set verbose ui I'm still not exactly sure why this is necessary -- perhaps setting it unconditionally would leak this setting in chg invocations. Regardless, this would have looked very out of place as compared to how this setting is done everywhere else, so at least for the sake of style, let's be consistent with the rest of the codebase. diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -1230,12 +1230,13 @@ def addln(win, y, x, line, color=None): def patchcontents(state): repo = state['repo'] rule = state['rules'][state['pos']] - repo.ui.verbose = True displayer = logcmdutil.changesetdisplayer(repo.ui, repo, { "patch": True, "template": "status" }, buffered=True) - displayer.show(rule.ctx) - displayer.close() + overrides = {('ui', 'verbose'): True} + with repo.ui.configoverride(overrides, source='histedit'): + displayer.show(rule.ctx) + displayer.close() return displayer.hunk[rule.ctx.rev()].splitlines() def _chisteditmain(repo, rules, stdscr):