commit: no longer allow empty commit with the 'force' argument (API)
The new way to allow empty commit is to temporarily set the
'ui.allowemptycommit' config option.
allowemptyback = repo.ui.backupconfig('ui', 'allowemptycommit')
try:
repo.ui.setconfig('ui', 'allowemptycommit', True)
repo.commit(...)
finally:
repo.ui.restoreconfig(allowemptyback)
All known uses of force for allowing empty commits have been removed, so let's
remove it from the allowemptycommits condition.
--- a/mercurial/localrepo.py Mon May 11 20:15:41 2015 -0700
+++ b/mercurial/localrepo.py Tue May 12 11:44:14 2015 -0700
@@ -1462,7 +1462,7 @@
cctx = context.workingcommitctx(self, status,
text, user, date, extra)
- allowemptycommit = (wctx.branch() != wctx.p1().branch() or force
+ allowemptycommit = (wctx.branch() != wctx.p1().branch()
or extra.get('close') or merge or cctx.files()
or self.ui.configbool('ui', 'allowemptycommit'))
if not allowemptycommit: