Show More
@@ -1,165 +1,216 b'' | |||||
1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
1 | $ . "$TESTDIR/histedit-helpers.sh" | |
2 |
|
2 | |||
3 | $ cat >> $HGRCPATH <<EOF |
|
3 | $ cat >> $HGRCPATH <<EOF | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > histedit= |
|
5 | > histedit= | |
6 | > EOF |
|
6 | > EOF | |
7 |
|
7 | |||
8 | $ initrepo () |
|
8 | $ initrepo () | |
9 | > { |
|
9 | > { | |
10 | > hg init r |
|
10 | > hg init r | |
11 | > cd r |
|
11 | > cd r | |
12 | > for x in a b c d e f ; do |
|
12 | > for x in a b c d e f ; do | |
13 | > echo $x > $x |
|
13 | > echo $x > $x | |
14 | > hg add $x |
|
14 | > hg add $x | |
15 | > hg ci -m $x |
|
15 | > hg ci -m $x | |
16 | > done |
|
16 | > done | |
17 | > echo a >> e |
|
17 | > echo a >> e | |
18 | > hg ci -m 'does not commute with e' |
|
18 | > hg ci -m 'does not commute with e' | |
19 | > cd .. |
|
19 | > cd .. | |
20 | > } |
|
20 | > } | |
21 |
|
21 | |||
22 | $ initrepo |
|
22 | $ initrepo | |
23 | $ cd r |
|
23 | $ cd r | |
24 |
|
24 | |||
25 | log before edit |
|
25 | log before edit | |
26 | $ hg log --graph |
|
26 | $ hg log --graph | |
27 | @ changeset: 6:bfa474341cc9 |
|
27 | @ changeset: 6:bfa474341cc9 | |
28 | | tag: tip |
|
28 | | tag: tip | |
29 | | user: test |
|
29 | | user: test | |
30 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
30 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
31 | | summary: does not commute with e |
|
31 | | summary: does not commute with e | |
32 | | |
|
32 | | | |
33 | o changeset: 5:652413bf663e |
|
33 | o changeset: 5:652413bf663e | |
34 | | user: test |
|
34 | | user: test | |
35 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
35 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
36 | | summary: f |
|
36 | | summary: f | |
37 | | |
|
37 | | | |
38 | o changeset: 4:e860deea161a |
|
38 | o changeset: 4:e860deea161a | |
39 | | user: test |
|
39 | | user: test | |
40 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
41 | | summary: e |
|
41 | | summary: e | |
42 | | |
|
42 | | | |
43 | o changeset: 3:055a42cdd887 |
|
43 | o changeset: 3:055a42cdd887 | |
44 | | user: test |
|
44 | | user: test | |
45 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
46 | | summary: d |
|
46 | | summary: d | |
47 | | |
|
47 | | | |
48 | o changeset: 2:177f92b77385 |
|
48 | o changeset: 2:177f92b77385 | |
49 | | user: test |
|
49 | | user: test | |
50 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
51 | | summary: c |
|
51 | | summary: c | |
52 | | |
|
52 | | | |
53 | o changeset: 1:d2ae7f538514 |
|
53 | o changeset: 1:d2ae7f538514 | |
54 | | user: test |
|
54 | | user: test | |
55 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
56 | | summary: b |
|
56 | | summary: b | |
57 | | |
|
57 | | | |
58 | o changeset: 0:cb9a9f314b8b |
|
58 | o changeset: 0:cb9a9f314b8b | |
59 | user: test |
|
59 | user: test | |
60 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | date: Thu Jan 01 00:00:00 1970 +0000 | |
61 | summary: a |
|
61 | summary: a | |
62 |
|
62 | |||
63 |
|
63 | |||
64 | edit the history |
|
64 | edit the history | |
65 | $ hg histedit 177f92b77385 --commands - 2>&1 <<EOF | fixbundle |
|
65 | $ hg histedit 177f92b77385 --commands - 2>&1 <<EOF | fixbundle | |
66 | > pick 177f92b77385 c |
|
66 | > pick 177f92b77385 c | |
67 | > pick 055a42cdd887 d |
|
67 | > pick 055a42cdd887 d | |
68 | > pick bfa474341cc9 does not commute with e |
|
68 | > pick bfa474341cc9 does not commute with e | |
69 | > pick e860deea161a e |
|
69 | > pick e860deea161a e | |
70 | > pick 652413bf663e f |
|
70 | > pick 652413bf663e f | |
71 | > EOF |
|
71 | > EOF | |
72 | merging e |
|
72 | merging e | |
73 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') |
|
73 | warning: conflicts while merging e! (edit, then use 'hg resolve --mark') | |
74 | Fix up the change (pick e860deea161a) |
|
74 | Fix up the change (pick e860deea161a) | |
75 | (hg histedit --continue to resume) |
|
75 | (hg histedit --continue to resume) | |
76 |
|
76 | |||
77 | insert unsupported advisory merge record |
|
77 | insert unsupported advisory merge record | |
78 | $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x |
|
78 | $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x | |
79 | $ hg debugmergestate |
|
79 | $ hg debugmergestate | |
80 | * version 2 records |
|
80 | * version 2 records | |
81 | local: 8f7551c7e4a2f2efe0bc8c741baf7f227d65d758 |
|
81 | local: 8f7551c7e4a2f2efe0bc8c741baf7f227d65d758 | |
82 | other: e860deea161a2f77de56603b340ebbb4536308ae |
|
82 | other: e860deea161a2f77de56603b340ebbb4536308ae | |
83 | labels: |
|
83 | labels: | |
84 | local: local |
|
84 | local: local | |
85 | other: histedit |
|
85 | other: histedit | |
86 | unrecognized entry: x advisory record |
|
86 | unrecognized entry: x advisory record | |
87 | file extras: e (ancestorlinknode = 0000000000000000000000000000000000000000) |
|
87 | file extras: e (ancestorlinknode = 0000000000000000000000000000000000000000) | |
88 | file: e (record type "F", state "u", hash 58e6b3a414a1e090dfc6029add0f3555ccba127f) |
|
88 | file: e (record type "F", state "u", hash 58e6b3a414a1e090dfc6029add0f3555ccba127f) | |
89 | local path: e (flags "") |
|
89 | local path: e (flags "") | |
90 | ancestor path: e (node null) |
|
90 | ancestor path: e (node null) | |
91 | other path: e (node 6b67ccefd5ce6de77e7ead4f5292843a0255329f) |
|
91 | other path: e (node 6b67ccefd5ce6de77e7ead4f5292843a0255329f) | |
92 | $ hg resolve -l |
|
92 | $ hg resolve -l | |
93 | U e |
|
93 | U e | |
94 |
|
94 | |||
95 | insert unsupported mandatory merge record |
|
95 | insert unsupported mandatory merge record | |
96 | $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X |
|
96 | $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X | |
97 | $ hg debugmergestate |
|
97 | $ hg debugmergestate | |
98 | * version 2 records |
|
98 | * version 2 records | |
99 | local: 8f7551c7e4a2f2efe0bc8c741baf7f227d65d758 |
|
99 | local: 8f7551c7e4a2f2efe0bc8c741baf7f227d65d758 | |
100 | other: e860deea161a2f77de56603b340ebbb4536308ae |
|
100 | other: e860deea161a2f77de56603b340ebbb4536308ae | |
101 | labels: |
|
101 | labels: | |
102 | local: local |
|
102 | local: local | |
103 | other: histedit |
|
103 | other: histedit | |
104 | file extras: e (ancestorlinknode = 0000000000000000000000000000000000000000) |
|
104 | file extras: e (ancestorlinknode = 0000000000000000000000000000000000000000) | |
105 | file: e (record type "F", state "u", hash 58e6b3a414a1e090dfc6029add0f3555ccba127f) |
|
105 | file: e (record type "F", state "u", hash 58e6b3a414a1e090dfc6029add0f3555ccba127f) | |
106 | local path: e (flags "") |
|
106 | local path: e (flags "") | |
107 | ancestor path: e (node null) |
|
107 | ancestor path: e (node null) | |
108 | other path: e (node 6b67ccefd5ce6de77e7ead4f5292843a0255329f) |
|
108 | other path: e (node 6b67ccefd5ce6de77e7ead4f5292843a0255329f) | |
109 | unrecognized entry: X mandatory record |
|
109 | unrecognized entry: X mandatory record | |
110 | $ hg resolve -l |
|
110 | $ hg resolve -l | |
111 | abort: unsupported merge state records: X |
|
111 | abort: unsupported merge state records: X | |
112 | (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) |
|
112 | (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) | |
113 | [255] |
|
113 | [255] | |
114 | $ hg resolve -ma |
|
114 | $ hg resolve -ma | |
115 | abort: unsupported merge state records: X |
|
115 | abort: unsupported merge state records: X | |
116 | (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) |
|
116 | (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) | |
117 | [255] |
|
117 | [255] | |
118 |
|
118 | |||
119 | abort the edit (should clear out merge state) |
|
119 | abort the edit (should clear out merge state) | |
120 | $ hg histedit --abort 2>&1 | fixbundle |
|
120 | $ hg histedit --abort 2>&1 | fixbundle | |
121 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
121 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
122 | $ hg debugmergestate |
|
122 | $ hg debugmergestate | |
123 | no merge state found |
|
123 | no merge state found | |
124 |
|
124 | |||
125 | log after abort |
|
125 | log after abort | |
126 | $ hg resolve -l |
|
126 | $ hg resolve -l | |
127 | $ hg log --graph |
|
127 | $ hg log --graph | |
128 | @ changeset: 6:bfa474341cc9 |
|
128 | @ changeset: 6:bfa474341cc9 | |
129 | | tag: tip |
|
129 | | tag: tip | |
130 | | user: test |
|
130 | | user: test | |
131 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
131 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
132 | | summary: does not commute with e |
|
132 | | summary: does not commute with e | |
133 | | |
|
133 | | | |
134 | o changeset: 5:652413bf663e |
|
134 | o changeset: 5:652413bf663e | |
135 | | user: test |
|
135 | | user: test | |
136 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
136 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
137 | | summary: f |
|
137 | | summary: f | |
138 | | |
|
138 | | | |
139 | o changeset: 4:e860deea161a |
|
139 | o changeset: 4:e860deea161a | |
140 | | user: test |
|
140 | | user: test | |
141 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
141 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
142 | | summary: e |
|
142 | | summary: e | |
143 | | |
|
143 | | | |
144 | o changeset: 3:055a42cdd887 |
|
144 | o changeset: 3:055a42cdd887 | |
145 | | user: test |
|
145 | | user: test | |
146 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
146 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
147 | | summary: d |
|
147 | | summary: d | |
148 | | |
|
148 | | | |
149 | o changeset: 2:177f92b77385 |
|
149 | o changeset: 2:177f92b77385 | |
150 | | user: test |
|
150 | | user: test | |
151 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
151 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
152 | | summary: c |
|
152 | | summary: c | |
153 | | |
|
153 | | | |
154 | o changeset: 1:d2ae7f538514 |
|
154 | o changeset: 1:d2ae7f538514 | |
155 | | user: test |
|
155 | | user: test | |
156 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
156 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
157 | | summary: b |
|
157 | | summary: b | |
158 | | |
|
158 | | | |
159 | o changeset: 0:cb9a9f314b8b |
|
159 | o changeset: 0:cb9a9f314b8b | |
160 | user: test |
|
160 | user: test | |
161 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
161 | date: Thu Jan 01 00:00:00 1970 +0000 | |
162 | summary: a |
|
162 | summary: a | |
163 |
|
163 | |||
164 |
|
164 | |||
|
165 | Early tree conflict doesn't leave histedit in a wedged state. | |||
|
166 | $ hg rm c | |||
|
167 | $ hg ci -m 'remove c' | |||
|
168 | $ echo collision > c | |||
|
169 | ||||
|
170 | $ hg histedit e860deea161a --commands - 2>&1 <<EOF | |||
|
171 | > edit e860deea161a | |||
|
172 | > pick 652413bf663e | |||
|
173 | > pick bfa474341cc9 | |||
|
174 | > pick 1b0954ff00fc | |||
|
175 | > EOF | |||
|
176 | c: untracked file differs | |||
|
177 | abort: untracked files in working directory differ from files in requested revision | |||
|
178 | [255] | |||
|
179 | ||||
|
180 | BUG: we didn't actually change p1 of the working copy, but we're in a | |||
|
181 | histedit state. This confuses the process very badly and leads to | |||
|
182 | histedit stripping things it shouldn't (in obsmarker mode it inserts | |||
|
183 | bogus prune markers in this case.) | |||
|
184 | ||||
|
185 | $ hg log -r 'p1()' -T'{node}\n' | |||
|
186 | 1b0954ff00fccb15a37b679e4a35e9b01dfe685e | |||
|
187 | $ hg status --config ui.tweakdefaults=yes | |||
|
188 | ? c | |||
|
189 | ? e.orig | |||
|
190 | # The repository is in an unfinished *histedit* state. | |||
|
191 | ||||
|
192 | # To continue: hg histedit --continue | |||
|
193 | # To abort: hg histedit --abort | |||
|
194 | ||||
|
195 | $ hg histedit --continue | |||
|
196 | 652413bf663e: skipping changeset (no changes) | |||
|
197 | bfa474341cc9: skipping changeset (no changes) | |||
|
198 | 1b0954ff00fc: skipping changeset (no changes) | |||
|
199 | saved backup bundle to $TESTTMP/r/.hg/strip-backup/e860deea161a-a0738322-histedit.hg | |||
|
200 | ||||
|
201 | $ hg log -GTcompact | |||
|
202 | warning: ignoring unknown working parent 1b0954ff00fc! | |||
|
203 | o 3[tip] 055a42cdd887 1970-01-01 00:00 +0000 test | |||
|
204 | | d | |||
|
205 | | | |||
|
206 | o 2 177f92b77385 1970-01-01 00:00 +0000 test | |||
|
207 | | c | |||
|
208 | | | |||
|
209 | o 1 d2ae7f538514 1970-01-01 00:00 +0000 test | |||
|
210 | | b | |||
|
211 | | | |||
|
212 | o 0 cb9a9f314b8b 1970-01-01 00:00 +0000 test | |||
|
213 | a | |||
|
214 | ||||
|
215 | ||||
165 | $ cd .. |
|
216 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now