Mercurial > hg
changeset 41206:6acbe86c6490
repair: move ui.history-editing-backup to [rewrite] section
Since we have the "rewrite" section for general history-editing options, the
backup option should be there.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 12 Jan 2019 17:43:36 +0900 |
parents | 3f807237dc94 |
children | 25cec00b333c |
files | hgext/histedit.py hgext/rebase.py mercurial/cmdutil.py mercurial/configitems.py tests/test-amend.t tests/test-histedit-no-backup.t tests/test-rebase-backup.t |
diffstat | 7 files changed, 35 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/histedit.py Wed Jan 09 19:54:01 2019 -0800 +++ b/hgext/histedit.py Sat Jan 12 17:43:36 2019 +0900 @@ -1680,8 +1680,8 @@ fm.startitem() goal = _getgoal(opts) revs = opts.get('rev', []) - # experimental config: ui.history-editing-backup - nobackup = not ui.configbool('ui', 'history-editing-backup') + # experimental config: rewrite.backup-bundle + nobackup = not ui.configbool('rewrite', 'backup-bundle') rules = opts.get('commands', '') state.keep = opts.get('keep', False)
--- a/hgext/rebase.py Wed Jan 09 19:54:01 2019 -0800 +++ b/hgext/rebase.py Sat Jan 12 17:43:36 2019 +0900 @@ -177,7 +177,7 @@ if e: self.extrafns = [e] - self.backupf = ui.configbool('ui', 'history-editing-backup') + self.backupf = ui.configbool('rewrite', 'backup-bundle') self.keepf = opts.get('keep', False) self.keepbranchesf = opts.get('keepbranches', False) self.obsoletenotrebased = {}
--- a/mercurial/cmdutil.py Wed Jan 09 19:54:01 2019 -0800 +++ b/mercurial/cmdutil.py Sat Jan 12 17:43:36 2019 +0900 @@ -2588,7 +2588,7 @@ obsmetadata = None if opts.get('note'): obsmetadata = {'note': encoding.fromlocal(opts['note'])} - backup = ui.configbool('ui', 'history-editing-backup') + backup = ui.configbool('rewrite', 'backup-bundle') scmutil.cleanupnodes(repo, mapping, 'amend', metadata=obsmetadata, fixphase=True, targetphase=commitphase, backup=backup)
--- a/mercurial/configitems.py Wed Jan 09 19:54:01 2019 -0800 +++ b/mercurial/configitems.py Sat Jan 12 17:43:36 2019 +0900 @@ -991,6 +991,10 @@ default='1MB', alias=[('experimental', 'mmapindexthreshold')], ) +coreconfigitem('rewrite', 'backup-bundle', + default=True, + alias=[('ui', 'history-editing-backup')], +) coreconfigitem('rewrite', 'update-timestamp', default=False, ) @@ -1168,9 +1172,6 @@ coreconfigitem('ui', 'graphnodetemplate', default=None, ) -coreconfigitem('ui', 'history-editing-backup', - default=True, -) coreconfigitem('ui', 'interactive', default=None, )
--- a/tests/test-amend.t Wed Jan 09 19:54:01 2019 -0800 +++ b/tests/test-amend.t Sat Jan 12 17:43:36 2019 +0900 @@ -332,9 +332,9 @@ ? missing_content2_content3-untracked ? missing_missing_content3-untracked -========================================== -Test history-editing-backup config option| -========================================== +================================= +Test backup-bundle config option| +================================= $ hg init $TESTTMP/repo4 $ cd $TESTTMP/repo4 $ echo a>a @@ -346,20 +346,20 @@ #if obsstore-off $ hg amend saved backup bundle to $TESTTMP/repo4/.hg/strip-backup/95e899acf2ce-f11cb050-amend.hg -When history-editing-backup config option is set: +When backup-bundle config option is set: $ cat << EOF >> $HGRCPATH - > [ui] - > history-editing-backup = False + > [rewrite] + > backup-bundle = False > EOF $ echo fixed > b $ hg amend #else $ hg amend -When history-editing-backup config option is set: +When backup-bundle config option is set: $ cat << EOF >> $HGRCPATH - > [ui] - > history-editing-backup = False + > [rewrite] + > backup-bundle = False > EOF $ echo fixed > b $ hg amend
--- a/tests/test-histedit-no-backup.t Wed Jan 09 19:54:01 2019 -0800 +++ b/tests/test-histedit-no-backup.t Sat Jan 12 17:43:36 2019 +0900 @@ -6,9 +6,9 @@ > histedit= > EOF -========================================== -Test history-editing-backup config option| -========================================== +================================= +Test backup-bundle config option| +================================= Repo setup: $ hg init foo $ cd foo @@ -33,7 +33,7 @@ o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test one -Test when `history-editing-backup` config option is enabled: +Test when `backup-bundle` config option is enabled: $ hg histedit -r '36b4bdd91f5b' --commands - << EOF > pick 36b4bdd91f5b 0 one > pick 6153eb23e623 1 two @@ -49,11 +49,11 @@ saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg saved backup bundle to $TESTTMP/foo/.hg/strip-backup/5c0056670bce-b54b65d0-backup.hg -Test when `history-editing-backup` config option is not enabled +Test when `backup-bundle` config option is not enabled Enable config option: $ cat >>$HGRCPATH <<EOF - > [ui] - > history-editing-backup=False + > [rewrite] + > backup-bundle = False > EOF $ hg histedit -r '36b4bdd91f5b' --commands - << EOF
--- a/tests/test-rebase-backup.t Wed Jan 09 19:54:01 2019 -0800 +++ b/tests/test-rebase-backup.t Sat Jan 12 17:43:36 2019 +0900 @@ -3,9 +3,9 @@ > rebase= > EOF -========================================== -Test history-editing-backup config option | -========================================== +================================== +Test backup-bundle config option | +================================== Test with Pre-obsmarker rebase: 1) When config option is not set: $ hg init repo1 @@ -50,8 +50,8 @@ 2) When config option is set: $ cat << EOF >> $HGRCPATH - > [ui] - > history-editing-backup = False + > [rewrite] + > backup-bundle = False > EOF $ echo f>f @@ -116,10 +116,10 @@ | o 0: a -When history-editing-backup = True: +When backup-bundle = True: $ cat << EOF >> $HGRCPATH - > [ui] - > history-editing-backup = True + > [rewrite] + > backup-bundle = True > EOF $ hg rebase -s 5 -d . rebasing 5:1f8148a544ee "b" @@ -132,10 +132,10 @@ saved backup bundle to $TESTTMP/repo1/.hg/strip-backup/818c1a43c916-2b644d96-backup.hg rebase aborted -When history-editing-backup = False: +When backup-bundle = False: $ cat << EOF >> $HGRCPATH - > [ui] - > history-editing-backup = False + > [rewrite] + > backup-bundle = False > EOF $ hg rebase -s 5 -d . rebasing 5:1f8148a544ee "b"