##// END OF EJS Templates
amend: add a --draft option to set phase to draft...
Martin von Zweigbergk -
r50666:e78a4168 default
parent child Browse files
Show More
@@ -46,6 +46,7 b' command = registrar.command(cmdtable)'
46 _(b'mark a branch as closed, hiding it from the branch list'),
46 _(b'mark a branch as closed, hiding it from the branch list'),
47 ),
47 ),
48 (b's', b'secret', None, _(b'use the secret phase for committing')),
48 (b's', b'secret', None, _(b'use the secret phase for committing')),
49 (b'', b'draft', None, _(b'use the draft phase for committing')),
49 (b'n', b'note', b'', _(b'store a note on the amend')),
50 (b'n', b'note', b'', _(b'store a note on the amend')),
50 ]
51 ]
51 + cmdutil.walkopts
52 + cmdutil.walkopts
@@ -64,6 +65,7 b' def amend(ui, repo, *pats, **opts):'
64
65
65 See :hg:`help commit` for more details.
66 See :hg:`help commit` for more details.
66 """
67 """
68 cmdutil.check_at_most_one_arg(opts, 'draft', 'secret')
67 cmdutil.check_note_size(opts)
69 cmdutil.check_note_size(opts)
68
70
69 with repo.wlock(), repo.lock():
71 with repo.wlock(), repo.lock():
@@ -3019,6 +3019,8 b' def amend(ui, repo, old, extra, pats, op'
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
@@ -560,6 +560,12 b' Close branch'
560 close=1
560 close=1
561 phase=secret
561 phase=secret
562
562
563 `hg amend --draft` sets phase to draft
564
565 $ hg amend --draft -m declassified
566 $ hg log --limit 1 -T 'phase={phase}\n'
567 phase=draft
568
563 $ cd ..
569 $ cd ..
564
570
565 Corner case of amend from issue6157:
571 Corner case of amend from issue6157:
General Comments 0
You need to be logged in to leave comments. Login now