Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 25020:747055706e85
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.
author | Durham Goode <durham@fb.com> |
---|---|
date | Mon, 11 May 2015 20:15:41 -0700 |
parents | 0579b0c2ea2b |
children | d6e7ac651973 |
comparison
equal
deleted
inserted
replaced
25019:672e0558aed1 | 25020:747055706e85 |
---|---|
895 editform = mergeeditform(repo[None], 'import.normal') | 895 editform = mergeeditform(repo[None], 'import.normal') |
896 if opts.get('exact'): | 896 if opts.get('exact'): |
897 editor = None | 897 editor = None |
898 else: | 898 else: |
899 editor = getcommiteditor(editform=editform, **opts) | 899 editor = getcommiteditor(editform=editform, **opts) |
900 n = repo.commit(message, opts.get('user') or user, | 900 allowemptyback = repo.ui.backupconfig('ui', 'allowemptycommit') |
901 opts.get('date') or date, match=m, | 901 try: |
902 editor=editor, force=partial) | 902 if partial: |
903 repo.ui.setconfig('ui', 'allowemptycommit', True) | |
904 n = repo.commit(message, opts.get('user') or user, | |
905 opts.get('date') or date, match=m, | |
906 editor=editor) | |
907 finally: | |
908 repo.ui.restoreconfig(allowemptyback) | |
903 dsguard.close() | 909 dsguard.close() |
904 else: | 910 else: |
905 if opts.get('exact') or opts.get('import_branch'): | 911 if opts.get('exact') or opts.get('import_branch'): |
906 branch = branch or 'default' | 912 branch = branch or 'default' |
907 else: | 913 else: |