[PATCH V3] backout: commit changeset by default (BC)

Yuya Nishihara yuya at tcha.org
Sun Jan 17 08:56:49 CST 2016


On Fri, 15 Jan 2016 13:48:21 -0800, Ruslan Sayfutdinov wrote:
> # HG changeset patch
> # User Ruslan Sayfutdinov <sayfutdinov at fb.com>
> # Date 1452894393 28800
> #      Fri Jan 15 13:46:33 2016 -0800
> # Node ID 3c06509bafbf491cfcd3d6f31e4f533b9ef9c532
> # Parent  2916ebaef3129451bfd4f9f62487e70f74124d46
> backout: commit changeset by default (BC)
> 
> Add --no-commit flag to prevent it. This should make the hg user experience a little better.
> Some discussion can be found here: http://markmail.org/message/7jm7ro2ias6hxywy

Looks good to me, but can't be applied on the current tip. Can you rebase and
resend it?

> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -522,22 +522,24 @@
>  
>  @command('backout',
>      [('', 'merge', None, _('merge with old dirstate parent after backout')),
> -    ('', 'commit', None, _('commit if no conflicts were encountered')),
> +    ('', 'commit', None,
> +     _('commit if no conflicts were encountered (DEPRECATED)')),
> +    ('', 'no-commit', None, _('do not commit')),
>      ('', 'parent', '',
>       _('parent to choose when backing out merge (DEPRECATED)'), _('REV')),
>      ('r', 'rev', '', _('revision to backout'), _('REV')),
>      ('e', 'edit', False, _('invoke editor on commit messages')),
>      ] + mergetoolopts + walkopts + commitopts + commitopts2,
>      _('[OPTION]... [-r] REV'))
> -def backout(ui, repo, node=None, rev=None, commit=False, **opts):
> +def backout(ui, repo, node=None, rev=None, **opts):

> -def _dobackout(ui, repo, node=None, rev=None, commit=False, **opts):
> +def _dobackout(ui, repo, node=None, rev=None, **opts):
> +    if opts.get('commit') and opts.get('no_commit'):
> +        raise error.Abort(_("cannot use --commit with --no-commit"))

This check can be done before taking locks, but that isn't a big concern.


More information about the Mercurial-devel mailing list