diff -r d155bf11cf22 -r 71dbd6f6fcb8 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Fri Nov 15 15:58:56 2019 -0500 +++ b/mercurial/cmdutil.py Thu Nov 21 09:25:50 2019 +0100 @@ -1771,6 +1771,8 @@ overrides = {} if partial: overrides[(b'ui', b'allowemptycommit')] = True + if opts.get(b'secret'): + overrides[(b'phases', b'new-commit')] = b'secret' with repo.ui.configoverride(overrides, b'import'): n = repo.commit( message, user, date, match=m, editor=editor, extra=extra