Show More
@@ -1111,7 +1111,9 b' def _histedit(ui, repo, state, *freeargs' | |||
|
1111 | 1111 | fm.startitem() |
|
1112 | 1112 | goal = _getgoal(opts) |
|
1113 | 1113 | revs = opts.get('rev', []) |
|
1114 | nobackup = opts.get('no_backup') | |
|
1114 | # experimental config: ui.history-editing-backup | |
|
1115 | nobackup = (opts.get('no_backup') or | |
|
1116 | not ui.configbool('ui', 'history-editing-backup')) | |
|
1115 | 1117 | rules = opts.get('commands', '') |
|
1116 | 1118 | state.keep = opts.get('keep', False) |
|
1117 | 1119 |
@@ -1093,6 +1093,9 b" coreconfigitem('ui', 'formatted'," | |||
|
1093 | 1093 | coreconfigitem('ui', 'graphnodetemplate', |
|
1094 | 1094 | default=None, |
|
1095 | 1095 | ) |
|
1096 | coreconfigitem('ui', 'history-editing-backup', | |
|
1097 | default=True, | |
|
1098 | ) | |
|
1096 | 1099 | coreconfigitem('ui', 'interactive', |
|
1097 | 1100 | default=None, |
|
1098 | 1101 | ) |
@@ -93,3 +93,41 b' Check when --no-backup is passed' | |||
|
93 | 93 | o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test |
|
94 | 94 | one |
|
95 | 95 | |
|
96 | ========================================== | |
|
97 | Test history-editing-backup config option| | |
|
98 | ========================================== | |
|
99 | Test when `history-editing-backup` config option is enabled: | |
|
100 | $ hg histedit -r '36b4bdd91f5b' --commands - << EOF | |
|
101 | > pick 36b4bdd91f5b 0 one | |
|
102 | > pick 6153eb23e623 1 two | |
|
103 | > roll 80d23dfa866d 2 three | |
|
104 | > edit 7d5187087c79 3 four | |
|
105 | > EOF | |
|
106 | merging file | |
|
107 | Editing (7d5187087c79), you may commit or record as needed now. | |
|
108 | (hg histedit --continue to resume) | |
|
109 | [1] | |
|
110 | $ hg histedit --abort | |
|
111 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
112 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg | |
|
113 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/5c0056670bce-b54b65d0-backup.hg | |
|
114 | ||
|
115 | Test when `history-editing-backup` config option is not enabled | |
|
116 | Enable config option: | |
|
117 | $ cat >>$HGRCPATH <<EOF | |
|
118 | > [ui] | |
|
119 | > history-editing-backup=False | |
|
120 | > EOF | |
|
121 | ||
|
122 | $ hg histedit -r '36b4bdd91f5b' --commands - << EOF | |
|
123 | > pick 36b4bdd91f5b 0 one | |
|
124 | > pick 6153eb23e623 1 two | |
|
125 | > roll 80d23dfa866d 2 three | |
|
126 | > edit 7d5187087c79 3 four | |
|
127 | > EOF | |
|
128 | merging file | |
|
129 | Editing (7d5187087c79), you may commit or record as needed now. | |
|
130 | (hg histedit --continue to resume) | |
|
131 | [1] | |
|
132 | $ hg histedit --abort | |
|
133 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
General Comments 0
You need to be logged in to leave comments.
Login now