# HG changeset patch # User Durham Goode # Date 1431391882 25200 # Node ID 672e0558aed12861208e7a263fb985c06b12ee36 # Parent 93e015a3d1eabe5771d083ba44b8d46dc318e8b8 mq: use ui.allowemptycommit to allow empty commits Previously, mq used the force flag to allow empty commits. Now that we have ui.allowemptycommit let's switch to that instead. We can't completely remove the force flag since it is used for a bunch of other behavior in localrepo.commit. diff -r 93e015a3d1ea -r 672e0558aed1 hgext/mq.py --- a/hgext/mq.py Mon May 11 16:18:28 2015 -0700 +++ b/hgext/mq.py Mon May 11 17:51:22 2015 -0700 @@ -376,14 +376,17 @@ if repo.ui.configbool('mq', 'secret', False): phase = phases.secret if phase is not None: - backup = repo.ui.backupconfig('phases', 'new-commit') + 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') + repo.ui.setconfig('ui', 'allowemptycommit', True) return repo.commit(*args, **kwargs) finally: + repo.ui.restoreconfig(allowemptybackup) if phase is not None: - repo.ui.restoreconfig(backup) + repo.ui.restoreconfig(phasebackup) class AbortNoCleanup(error.Abort): pass