import: use ui.allowemptycommit to allow empty commits
Previously import used force=partial to allow empty commits to be made. Let's
switch it to using the new ui.allowemptycommit option. Tests says we can drop
the 'force' argument in the processs.
--- a/mercurial/cmdutil.py Mon May 11 17:51:22 2015 -0700
+++ b/mercurial/cmdutil.py Mon May 11 20:15:41 2015 -0700
@@ -897,9 +897,15 @@
editor = None
else:
editor = getcommiteditor(editform=editform, **opts)
- n = repo.commit(message, opts.get('user') or user,
- opts.get('date') or date, match=m,
- editor=editor, force=partial)
+ allowemptyback = repo.ui.backupconfig('ui', 'allowemptycommit')
+ try:
+ if partial:
+ repo.ui.setconfig('ui', 'allowemptycommit', True)
+ n = repo.commit(message, opts.get('user') or user,
+ opts.get('date') or date, match=m,
+ editor=editor)
+ finally:
+ repo.ui.restoreconfig(allowemptyback)
dsguard.close()
else:
if opts.get('exact') or opts.get('import_branch'):