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

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Aug 2 09:49:54 EDT 2018


yuja added a comment.


  >   - 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)
  >     1. Fixing the dirstate because localrepo.commitctx does not update
  >     2. 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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3968

To: khanchi97, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list