Show More
@@ -925,7 +925,6 b' def findoutgoing(ui, repo, remote=None, ' | |||||
925 | _("don't strip old nodes after edit is complete")), |
|
925 | _("don't strip old nodes after edit is complete")), | |
926 | ('', 'abort', False, _('abort an edit in progress')), |
|
926 | ('', 'abort', False, _('abort an edit in progress')), | |
927 | ('o', 'outgoing', False, _('changesets not found in destination')), |
|
927 | ('o', 'outgoing', False, _('changesets not found in destination')), | |
928 | ('', 'no-backup', False, _('do not save backup copies of files')), |
|
|||
929 | ('f', 'force', False, |
|
928 | ('f', 'force', False, | |
930 | _('force outgoing even for unrelated repositories')), |
|
929 | _('force outgoing even for unrelated repositories')), | |
931 | ('r', 'rev', [], _('first revision to be edited'), _('REV'))] + |
|
930 | ('r', 'rev', [], _('first revision to be edited'), _('REV'))] + | |
@@ -1112,8 +1111,7 b' def _histedit(ui, repo, state, *freeargs' | |||||
1112 | goal = _getgoal(opts) |
|
1111 | goal = _getgoal(opts) | |
1113 | revs = opts.get('rev', []) |
|
1112 | revs = opts.get('rev', []) | |
1114 | # experimental config: ui.history-editing-backup |
|
1113 | # experimental config: ui.history-editing-backup | |
1115 | nobackup = (opts.get('no_backup') or |
|
1114 | nobackup = not ui.configbool('ui', 'history-editing-backup') | |
1116 | not ui.configbool('ui', 'history-editing-backup')) |
|
|||
1117 | rules = opts.get('commands', '') |
|
1115 | rules = opts.get('commands', '') | |
1118 | state.keep = opts.get('keep', False) |
|
1116 | state.keep = opts.get('keep', False) | |
1119 |
|
1117 |
@@ -6,6 +6,9 b' Enable extension used by this test' | |||||
6 | > histedit= |
|
6 | > histedit= | |
7 | > EOF |
|
7 | > EOF | |
8 |
|
8 | |||
|
9 | ========================================== | |||
|
10 | Test history-editing-backup config option| | |||
|
11 | ========================================== | |||
9 | Repo setup: |
|
12 | Repo setup: | |
10 | $ hg init foo |
|
13 | $ hg init foo | |
11 | $ cd foo |
|
14 | $ cd foo | |
@@ -30,72 +33,6 b' Repo setup:' | |||||
30 | o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test |
|
33 | o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test | |
31 | one |
|
34 | one | |
32 |
|
35 | |||
33 | Check when --no-backup is not passed |
|
|||
34 | $ hg histedit -r '36b4bdd91f5b' --commands - << EOF |
|
|||
35 | > pick 36b4bdd91f5b 0 one |
|
|||
36 | > pick 6153eb23e623 1 two |
|
|||
37 | > roll 80d23dfa866d 2 three |
|
|||
38 | > edit 7d5187087c79 3 four |
|
|||
39 | > EOF |
|
|||
40 | merging file |
|
|||
41 | Editing (7d5187087c79), you may commit or record as needed now. |
|
|||
42 | (hg histedit --continue to resume) |
|
|||
43 | [1] |
|
|||
44 |
|
||||
45 | $ hg histedit --abort |
|
|||
46 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
47 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg |
|
|||
48 | saved backup bundle to $TESTTMP/foo/.hg/strip-backup/5c0056670bce-b54b65d0-backup.hg |
|
|||
49 |
|
||||
50 | $ hg st |
|
|||
51 | $ hg diff |
|
|||
52 | $ hg log -G --style compact |
|
|||
53 | @ 3[tip] 7d5187087c79 1970-01-01 00:00 +0000 test |
|
|||
54 | | four |
|
|||
55 | | |
|
|||
56 | o 2 80d23dfa866d 1970-01-01 00:00 +0000 test |
|
|||
57 | | three |
|
|||
58 | | |
|
|||
59 | o 1 6153eb23e623 1970-01-01 00:00 +0000 test |
|
|||
60 | | two |
|
|||
61 | | |
|
|||
62 | o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test |
|
|||
63 | one |
|
|||
64 |
|
||||
65 |
|
||||
66 | Check when --no-backup is passed |
|
|||
67 | $ hg histedit -r '36b4bdd91f5b' --commands - << EOF |
|
|||
68 | > pick 36b4bdd91f5b 0 one |
|
|||
69 | > pick 6153eb23e623 1 two |
|
|||
70 | > roll 80d23dfa866d 2 three |
|
|||
71 | > edit 7d5187087c79 3 four |
|
|||
72 | > EOF |
|
|||
73 | merging file |
|
|||
74 | Editing (7d5187087c79), you may commit or record as needed now. |
|
|||
75 | (hg histedit --continue to resume) |
|
|||
76 | [1] |
|
|||
77 |
|
||||
78 | $ hg histedit --abort --no-backup |
|
|||
79 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
|||
80 |
|
||||
81 | $ hg st |
|
|||
82 | $ hg diff |
|
|||
83 | $ hg log -G --style compact |
|
|||
84 | @ 3[tip] 7d5187087c79 1970-01-01 00:00 +0000 test |
|
|||
85 | | four |
|
|||
86 | | |
|
|||
87 | o 2 80d23dfa866d 1970-01-01 00:00 +0000 test |
|
|||
88 | | three |
|
|||
89 | | |
|
|||
90 | o 1 6153eb23e623 1970-01-01 00:00 +0000 test |
|
|||
91 | | two |
|
|||
92 | | |
|
|||
93 | o 0 36b4bdd91f5b 1970-01-01 00:00 +0000 test |
|
|||
94 | one |
|
|||
95 |
|
||||
96 | ========================================== |
|
|||
97 | Test history-editing-backup config option| |
|
|||
98 | ========================================== |
|
|||
99 | Test when `history-editing-backup` config option is enabled: |
|
36 | Test when `history-editing-backup` config option is enabled: | |
100 | $ hg histedit -r '36b4bdd91f5b' --commands - << EOF |
|
37 | $ hg histedit -r '36b4bdd91f5b' --commands - << EOF | |
101 | > pick 36b4bdd91f5b 0 one |
|
38 | > pick 36b4bdd91f5b 0 one |
General Comments 0
You need to be logged in to leave comments.
Login now