Mercurial > hg
comparison hgext/uncommit.py @ 42936:2da754532dd3
uncommit: enable support for adding a note
This comes from the evolve extension's version of uncommit. The logic was
already in place, and appears to be the last of the trivial things that can be
enabled.
Should these note options (including on amend) be marked advanced to keep the
help text clutter level down?
Differential Revision: https://phab.mercurial-scm.org/D6857
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 15 Sep 2019 00:07:30 -0400 |
parents | 66048f6b5d0d |
children | 44be33cf7a57 |
comparison
equal
deleted
inserted
replaced
42935:f10a0f5eedae | 42936:2da754532dd3 |
---|---|
109 return repo.commitctx(new) | 109 return repo.commitctx(new) |
110 | 110 |
111 @command('uncommit', | 111 @command('uncommit', |
112 [('', 'keep', None, _('allow an empty commit after uncommiting')), | 112 [('', 'keep', None, _('allow an empty commit after uncommiting')), |
113 ('', 'allow-dirty-working-copy', False, | 113 ('', 'allow-dirty-working-copy', False, |
114 _('allow uncommit with outstanding changes')) | 114 _('allow uncommit with outstanding changes')), |
115 (b'n', b'note', b'', _(b'store a note on uncommit'), _(b'TEXT')) | |
115 ] + commands.walkopts + commands.commitopts + commands.commitopts2 | 116 ] + commands.walkopts + commands.commitopts + commands.commitopts2 |
116 + commands.commitopts3, | 117 + commands.commitopts3, |
117 _('[OPTION]... [FILE]...'), | 118 _('[OPTION]... [FILE]...'), |
118 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT) | 119 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT) |
119 def uncommit(ui, repo, *pats, **opts): | 120 def uncommit(ui, repo, *pats, **opts): |
127 If no files are specified, the commit will be pruned, unless --keep is | 128 If no files are specified, the commit will be pruned, unless --keep is |
128 given. | 129 given. |
129 """ | 130 """ |
130 opts = pycompat.byteskwargs(opts) | 131 opts = pycompat.byteskwargs(opts) |
131 | 132 |
133 cmdutil.checknotesize(ui, opts) | |
132 cmdutil.resolvecommitoptions(ui, opts) | 134 cmdutil.resolvecommitoptions(ui, opts) |
133 | 135 |
134 with repo.wlock(), repo.lock(): | 136 with repo.wlock(), repo.lock(): |
135 | 137 |
136 m, a, r, d = repo.status()[:4] | 138 m, a, r, d = repo.status()[:4] |