hgext/amend.py
changeset 49771 e78a41686464
parent 48875 6000f5b25c9b
equal deleted inserted replaced
49770:f0e9dda408b3 49771:e78a41686464
    44             b'close-branch',
    44             b'close-branch',
    45             None,
    45             None,
    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
    52     + cmdutil.commitopts
    53     + cmdutil.commitopts
    53     + cmdutil.commitopts2
    54     + cmdutil.commitopts2
    62     Similar to :hg:`commit --amend`, but reuse the commit message without
    63     Similar to :hg:`commit --amend`, but reuse the commit message without
    63     invoking editor, unless ``--edit`` was set.
    64     invoking editor, unless ``--edit`` was set.
    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():
    70         if not opts.get('logfile'):
    72         if not opts.get('logfile'):
    71             opts['message'] = opts.get('message') or repo[b'.'].description()
    73             opts['message'] = opts.get('message') or repo[b'.'].description()