Mercurial > hg
diff hgext/amend.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 | 6000f5b25c9b |
children |
line wrap: on
line diff
--- a/hgext/amend.py Tue Nov 29 13:07:16 2022 -0800 +++ b/hgext/amend.py Tue Nov 29 15:41:28 2022 -0800 @@ -46,6 +46,7 @@ _(b'mark a branch as closed, hiding it from the branch list'), ), (b's', b'secret', None, _(b'use the secret phase for committing')), + (b'', b'draft', None, _(b'use the draft phase for committing')), (b'n', b'note', b'', _(b'store a note on the amend')), ] + cmdutil.walkopts @@ -64,6 +65,7 @@ See :hg:`help commit` for more details. """ + cmdutil.check_at_most_one_arg(opts, 'draft', 'secret') cmdutil.check_note_size(opts) with repo.wlock(), repo.lock():