--- a/hgext/record.py Thu Mar 16 14:23:49 2017 -0700
+++ b/hgext/record.py Thu Mar 16 14:34:35 2017 -0700
@@ -68,12 +68,9 @@
'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 @@
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']: