comparison 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
comparison
equal deleted inserted replaced
49771:f0e9dda408b3 49772:e78a41686464
3017 return old.node() 3017 return old.node()
3018 3018
3019 commitphase = None 3019 commitphase = None
3020 if opts.get(b'secret'): 3020 if opts.get(b'secret'):
3021 commitphase = phases.secret 3021 commitphase = phases.secret
3022 elif opts.get(b'draft'):
3023 commitphase = phases.draft
3022 newid = repo.commitctx(new) 3024 newid = repo.commitctx(new)
3023 ms.reset() 3025 ms.reset()
3024 3026
3025 with repo.dirstate.parentchange(): 3027 with repo.dirstate.parentchange():
3026 # Reroute the working copy parent to the new changeset 3028 # Reroute the working copy parent to the new changeset