diff mercurial/cmdutil.py @ 49772:e78a41686464

amend: add a --draft option to set phase to draft Some users create commits in secret phase by default and then want to make them draft so they can be uploaded. This patch adds a --draft option for that. We already have a flag for changing the phase to secret, so it seems consistent to have one for draft.
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 29 Nov 2022 15:41:28 -0800
parents cdfba684b6a1
children c166b212bdee
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue Nov 29 13:07:16 2022 -0800
+++ b/mercurial/cmdutil.py	Tue Nov 29 15:41:28 2022 -0800
@@ -3019,6 +3019,8 @@
         commitphase = None
         if opts.get(b'secret'):
             commitphase = phases.secret
+        elif opts.get(b'draft'):
+            commitphase = phases.draft
         newid = repo.commitctx(new)
         ms.reset()