# HG changeset patch # User Jun Wu # Date 2017-03-16 21:34:35 # Node ID 2017b5a5685b72f21b1a96cf2e562a29c5e794a6 # Parent 707f9fd2dcad931fd436f3bc91cfa7054ed681b2 record: get rid of ui.backupconfig diff --git a/hgext/record.py b/hgext/record.py --- a/hgext/record.py +++ b/hgext/record.py @@ -68,12 +68,9 @@ def record(ui, repo, *pats, **opts): 'commit') opts["interactive"] = True - backup = ui.backupconfig('experimental', 'crecord') - try: - ui.setconfig('experimental', 'crecord', False, 'record') + overrides = {('experimental', 'crecord'): False} + with ui.configoverride(overrides, 'record'): return commands.commit(ui, repo, *pats, **opts) - finally: - ui.restoreconfig(backup) def qrefresh(origfn, ui, repo, *pats, **opts): if not opts['interactive']: @@ -117,13 +114,10 @@ def _qrecord(cmdsuggest, ui, repo, patch opts['checkname'] = False mq.new(ui, repo, patch, *pats, **opts) - backup = ui.backupconfig('experimental', 'crecord') - try: - ui.setconfig('experimental', 'crecord', False, 'record') + overrides = {('experimental', 'crecord'): False} + with ui.configoverride(overrides, 'record'): cmdutil.dorecord(ui, repo, committomq, cmdsuggest, False, cmdutil.recordfilter, *pats, **opts) - finally: - ui.restoreconfig(backup) def qnew(origfn, ui, repo, patch, *args, **opts): if opts['interactive']: