D3968: amend: support "history-editing-backup" config option

Yuya Nishihara yuya at tcha.org
Thu Aug 2 13:49:08 UTC 2018


> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -2556,8 +2556,10 @@
>          obsmetadata = None
>          if opts.get('note'):
>              obsmetadata = {'note': encoding.fromlocal(opts['note'])}
> +        backup = opts.get('backup')
>          scmutil.cleanupnodes(repo, mapping, 'amend', metadata=obsmetadata,
> -                             fixphase=True, targetphase=commitphase)
> +                             fixphase=True, targetphase=commitphase,
> +                             backup=backup)
>  
>          # Fixing the dirstate because localrepo.commitctx does not update
>          # it. This is rather convenient because we did not need to update
> diff --git a/hgext/amend.py b/hgext/amend.py
> --- a/hgext/amend.py
> +++ b/hgext/amend.py
> @@ -54,4 +54,6 @@
>          if not opts.get('logfile'):
>              opts['message'] = opts.get('message') or repo['.'].description()
>          opts['amend'] = True
> +        backup = ui.configbool('ui', 'history-editing-backup')
> +        opts['backup'] = backup
>          return commands._docommit(ui, repo, *pats, **pycompat.strkwargs(opts))

No need to pass by opts since cmdutil.amend() can read ui.config.


More information about the Mercurial-devel mailing list