diff mercurial/commands.py @ 43758:71dbd6f6fcb8

import: add a --secret option Similarly to "hg commit", we add a --secret option to "hg import" for committing with the secret phase. The option has no short form since there already is a "-s" for "--similarity". .. feature:: ``hg import`` has a new --secret option for committing with the secret phase.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Thu, 21 Nov 2019 09:25:50 +0100
parents f37da59a36d9
children a6483107a07a
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Nov 15 15:58:56 2019 -0500
+++ b/mercurial/commands.py	Thu Nov 21 09:25:50 2019 +0100
@@ -4033,6 +4033,7 @@
             _(b'NUM'),
         ),
         (b'b', b'base', b'', _(b'base path (DEPRECATED)'), _(b'PATH')),
+        (b'', b'secret', None, _(b'use the secret phase for committing')),
         (b'e', b'edit', False, _(b'invoke editor on commit messages')),
         (
             b'f',
@@ -4181,6 +4182,8 @@
     update = not opts.get(b'bypass')
     if not update and opts.get(b'no_commit'):
         raise error.Abort(_(b'cannot use --no-commit with --bypass'))
+    if opts.get(b'secret') and opts.get(b'no_commit'):
+        raise error.Abort(_(b'cannot use --no-commit with --secret'))
     try:
         sim = float(opts.get(b'similarity') or 0)
     except ValueError: