--- a/hgext/mq.py Thu Mar 16 14:36:35 2017 -0700
+++ b/hgext/mq.py Thu Mar 16 14:39:18 2017 -0700
@@ -405,18 +405,12 @@
if phase is None:
if repo.ui.configbool('mq', 'secret', False):
phase = phases.secret
+ overrides = {('ui', 'allowemptycommit'): True}
if phase is not None:
- phasebackup = repo.ui.backupconfig('phases', 'new-commit')
- allowemptybackup = repo.ui.backupconfig('ui', 'allowemptycommit')
- try:
- if phase is not None:
- repo.ui.setconfig('phases', 'new-commit', phase, 'mq')
+ overrides[('phases', 'new-commit')] = phase
+ with repo.ui.configoverride(overrides, 'mq'):
repo.ui.setconfig('ui', 'allowemptycommit', True)
return repo.commit(*args, **kwargs)
- finally:
- repo.ui.restoreconfig(allowemptybackup)
- if phase is not None:
- repo.ui.restoreconfig(phasebackup)
class AbortNoCleanup(error.Abort):
pass