Show More
@@ -1,392 +1,394 | |||||
1 | $ cat >> $HGRCPATH <<EOF |
|
1 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
2 | > [extensions] | |
3 | > rebase= |
|
3 | > rebase= | |
4 | > |
|
4 | > | |
5 | > [phases] |
|
5 | > [phases] | |
6 | > publish=False |
|
6 | > publish=False | |
7 | > |
|
7 | > | |
8 | > [alias] |
|
8 | > [alias] | |
9 | > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n" |
|
9 | > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n" | |
10 | > EOF |
|
10 | > EOF | |
11 |
|
11 | |||
12 |
|
12 | |||
13 | $ hg init a |
|
13 | $ hg init a | |
14 | $ cd a |
|
14 | $ cd a | |
15 |
|
15 | |||
16 | $ touch .hg/rebasestate |
|
16 | $ touch .hg/rebasestate | |
17 | $ hg sum |
|
17 | $ hg sum | |
18 | parent: -1:000000000000 tip (empty repository) |
|
18 | parent: -1:000000000000 tip (empty repository) | |
19 | branch: default |
|
19 | branch: default | |
20 | commit: (clean) |
|
20 | commit: (clean) | |
21 | update: (current) |
|
21 | update: (current) | |
22 | abort: .hg/rebasestate is incomplete |
|
22 | abort: .hg/rebasestate is incomplete | |
23 | [255] |
|
23 | [255] | |
24 | $ rm .hg/rebasestate |
|
24 | $ rm .hg/rebasestate | |
25 |
|
25 | |||
26 | $ echo c1 > common |
|
26 | $ echo c1 > common | |
27 | $ hg add common |
|
27 | $ hg add common | |
28 | $ hg ci -m C1 |
|
28 | $ hg ci -m C1 | |
29 |
|
29 | |||
30 | $ echo c2 >> common |
|
30 | $ echo c2 >> common | |
31 | $ hg ci -m C2 |
|
31 | $ hg ci -m C2 | |
32 |
|
32 | |||
33 | $ echo c3 >> common |
|
33 | $ echo c3 >> common | |
34 | $ hg ci -m C3 |
|
34 | $ hg ci -m C3 | |
35 |
|
35 | |||
36 | $ hg up -q -C 1 |
|
36 | $ hg up -q -C 1 | |
37 |
|
37 | |||
38 | $ echo l1 >> extra |
|
38 | $ echo l1 >> extra | |
39 | $ hg add extra |
|
39 | $ hg add extra | |
40 | $ hg ci -m L1 |
|
40 | $ hg ci -m L1 | |
41 | created new head |
|
41 | created new head | |
42 |
|
42 | |||
43 | $ sed -e 's/c2/l2/' common > common.new |
|
43 | $ sed -e 's/c2/l2/' common > common.new | |
44 | $ mv common.new common |
|
44 | $ mv common.new common | |
45 | $ hg ci -m L2 |
|
45 | $ hg ci -m L2 | |
46 |
|
46 | |||
47 | $ hg phase --force --secret 2 |
|
47 | $ hg phase --force --secret 2 | |
48 |
|
48 | |||
49 | $ hg tglog |
|
49 | $ hg tglog | |
50 | @ 4:draft 'L2' |
|
50 | @ 4:draft 'L2' | |
51 | | |
|
51 | | | |
52 | o 3:draft 'L1' |
|
52 | o 3:draft 'L1' | |
53 | | |
|
53 | | | |
54 | | o 2:secret 'C3' |
|
54 | | o 2:secret 'C3' | |
55 | |/ |
|
55 | |/ | |
56 | o 1:draft 'C2' |
|
56 | o 1:draft 'C2' | |
57 | | |
|
57 | | | |
58 | o 0:draft 'C1' |
|
58 | o 0:draft 'C1' | |
59 |
|
59 | |||
60 |
|
60 | |||
61 | Conflicting rebase: |
|
61 | Conflicting rebase: | |
62 |
|
62 | |||
63 | $ hg rebase -s 3 -d 2 |
|
63 | $ hg rebase -s 3 -d 2 | |
64 | rebasing 3:3163e20567cc "L1" |
|
64 | rebasing 3:3163e20567cc "L1" | |
65 | rebasing 4:46f0b057b5c0 "L2" (tip) |
|
65 | rebasing 4:46f0b057b5c0 "L2" (tip) | |
66 | merging common |
|
66 | merging common | |
67 | warning: conflicts while merging common! (edit, then use 'hg resolve --mark') |
|
67 | warning: conflicts while merging common! (edit, then use 'hg resolve --mark') | |
68 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
68 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
69 | [1] |
|
69 | [1] | |
70 |
|
70 | |||
71 | Insert unsupported advisory merge record: |
|
71 | Insert unsupported advisory merge record: | |
72 |
|
72 | |||
73 | $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x |
|
73 | $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x | |
74 | $ hg debugmergestate |
|
74 | $ hg debugmergestate | |
75 | * version 2 records |
|
75 | * version 2 records | |
76 | local: 3e046f2ecedb793b97ed32108086edd1a162f8bc |
|
76 | local: 3e046f2ecedb793b97ed32108086edd1a162f8bc | |
77 | other: 46f0b057b5c061d276b91491c22151f78698abd2 |
|
77 | other: 46f0b057b5c061d276b91491c22151f78698abd2 | |
78 | unrecognized entry: x advisory record |
|
78 | unrecognized entry: x advisory record | |
79 | file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1) |
|
79 | file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1) | |
80 | local path: common (flags "") |
|
80 | local path: common (flags "") | |
81 | ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6) |
|
81 | ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6) | |
82 | other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5) |
|
82 | other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5) | |
83 | $ hg resolve -l |
|
83 | $ hg resolve -l | |
84 | U common |
|
84 | U common | |
85 |
|
85 | |||
86 | Insert unsupported mandatory merge record: |
|
86 | Insert unsupported mandatory merge record: | |
87 |
|
87 | |||
88 | $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X |
|
88 | $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X | |
89 | $ hg debugmergestate |
|
89 | $ hg debugmergestate | |
90 | * version 2 records |
|
90 | * version 2 records | |
91 | local: 3e046f2ecedb793b97ed32108086edd1a162f8bc |
|
91 | local: 3e046f2ecedb793b97ed32108086edd1a162f8bc | |
92 | other: 46f0b057b5c061d276b91491c22151f78698abd2 |
|
92 | other: 46f0b057b5c061d276b91491c22151f78698abd2 | |
93 | file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1) |
|
93 | file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1) | |
94 | local path: common (flags "") |
|
94 | local path: common (flags "") | |
95 | ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6) |
|
95 | ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6) | |
96 | other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5) |
|
96 | other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5) | |
97 | unrecognized entry: X mandatory record |
|
97 | unrecognized entry: X mandatory record | |
98 | $ hg resolve -l |
|
98 | $ hg resolve -l | |
99 | abort: unsupported merge state records: X |
|
99 | abort: unsupported merge state records: X | |
100 | (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) |
|
100 | (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) | |
101 | [255] |
|
101 | [255] | |
102 | $ hg resolve -ma |
|
102 | $ hg resolve -ma | |
103 | abort: unsupported merge state records: X |
|
103 | abort: unsupported merge state records: X | |
104 | (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) |
|
104 | (see https://mercurial-scm.org/wiki/MergeStateRecords for more information) | |
105 | [255] |
|
105 | [255] | |
106 |
|
106 | |||
107 | Abort (should clear out unsupported merge state): |
|
107 | Abort (should clear out unsupported merge state): | |
108 |
|
108 | |||
109 | $ hg rebase --abort |
|
109 | $ hg rebase --abort | |
110 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/3e046f2ecedb-6beef7d5-backup.hg (glob) |
|
110 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/3e046f2ecedb-6beef7d5-backup.hg (glob) | |
111 | rebase aborted |
|
111 | rebase aborted | |
112 | $ hg debugmergestate |
|
112 | $ hg debugmergestate | |
113 | no merge state found |
|
113 | no merge state found | |
114 |
|
114 | |||
115 | $ hg tglog |
|
115 | $ hg tglog | |
116 | @ 4:draft 'L2' |
|
116 | @ 4:draft 'L2' | |
117 | | |
|
117 | | | |
118 | o 3:draft 'L1' |
|
118 | o 3:draft 'L1' | |
119 | | |
|
119 | | | |
120 | | o 2:secret 'C3' |
|
120 | | o 2:secret 'C3' | |
121 | |/ |
|
121 | |/ | |
122 | o 1:draft 'C2' |
|
122 | o 1:draft 'C2' | |
123 | | |
|
123 | | | |
124 | o 0:draft 'C1' |
|
124 | o 0:draft 'C1' | |
125 |
|
125 | |||
126 | Test safety for inconsistent rebase state, which may be created (and |
|
126 | Test safety for inconsistent rebase state, which may be created (and | |
127 | forgotten) by Mercurial earlier than 2.7. This emulates Mercurial |
|
127 | forgotten) by Mercurial earlier than 2.7. This emulates Mercurial | |
128 | earlier than 2.7 by renaming ".hg/rebasestate" temporarily. |
|
128 | earlier than 2.7 by renaming ".hg/rebasestate" temporarily. | |
129 |
|
129 | |||
130 | $ hg rebase -s 3 -d 2 |
|
130 | $ hg rebase -s 3 -d 2 | |
131 | rebasing 3:3163e20567cc "L1" |
|
131 | rebasing 3:3163e20567cc "L1" | |
132 | rebasing 4:46f0b057b5c0 "L2" (tip) |
|
132 | rebasing 4:46f0b057b5c0 "L2" (tip) | |
133 | merging common |
|
133 | merging common | |
134 | warning: conflicts while merging common! (edit, then use 'hg resolve --mark') |
|
134 | warning: conflicts while merging common! (edit, then use 'hg resolve --mark') | |
135 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
135 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
136 | [1] |
|
136 | [1] | |
137 |
|
137 | |||
138 | $ mv .hg/rebasestate .hg/rebasestate.back |
|
138 | $ mv .hg/rebasestate .hg/rebasestate.back | |
139 | $ hg update --quiet --clean 2 |
|
139 | $ hg update --quiet --clean 2 | |
140 | $ hg --config extensions.mq= strip --quiet "destination()" |
|
140 | $ hg --config extensions.mq= strip --quiet "destination()" | |
141 | $ mv .hg/rebasestate.back .hg/rebasestate |
|
141 | $ mv .hg/rebasestate.back .hg/rebasestate | |
142 |
|
142 | |||
143 | $ hg rebase --continue |
|
143 | $ hg rebase --continue | |
144 | abort: cannot continue inconsistent rebase |
|
144 | abort: cannot continue inconsistent rebase | |
145 | (use "hg rebase --abort" to clear broken state) |
|
145 | (use "hg rebase --abort" to clear broken state) | |
146 | [255] |
|
146 | [255] | |
147 | $ hg summary | grep '^rebase: ' |
|
147 | $ hg summary | grep '^rebase: ' | |
148 | rebase: (use "hg rebase --abort" to clear broken state) |
|
148 | rebase: (use "hg rebase --abort" to clear broken state) | |
149 | $ hg rebase --abort |
|
149 | $ hg rebase --abort | |
150 | rebase aborted (no revision is removed, only broken state is cleared) |
|
150 | rebase aborted (no revision is removed, only broken state is cleared) | |
151 |
|
151 | |||
152 | $ cd .. |
|
152 | $ cd .. | |
153 |
|
153 | |||
154 |
|
154 | |||
155 | Construct new repo: |
|
155 | Construct new repo: | |
156 |
|
156 | |||
157 | $ hg init b |
|
157 | $ hg init b | |
158 | $ cd b |
|
158 | $ cd b | |
159 |
|
159 | |||
160 | $ echo a > a |
|
160 | $ echo a > a | |
161 | $ hg ci -Am A |
|
161 | $ hg ci -Am A | |
162 | adding a |
|
162 | adding a | |
163 |
|
163 | |||
164 | $ echo b > b |
|
164 | $ echo b > b | |
165 | $ hg ci -Am B |
|
165 | $ hg ci -Am B | |
166 | adding b |
|
166 | adding b | |
167 |
|
167 | |||
168 | $ echo c > c |
|
168 | $ echo c > c | |
169 | $ hg ci -Am C |
|
169 | $ hg ci -Am C | |
170 | adding c |
|
170 | adding c | |
171 |
|
171 | |||
172 | $ hg up -q 0 |
|
172 | $ hg up -q 0 | |
173 |
|
173 | |||
174 | $ echo b > b |
|
174 | $ echo b > b | |
175 | $ hg ci -Am 'B bis' |
|
175 | $ hg ci -Am 'B bis' | |
176 | adding b |
|
176 | adding b | |
177 | created new head |
|
177 | created new head | |
178 |
|
178 | |||
179 | $ echo c1 > c |
|
179 | $ echo c1 > c | |
180 | $ hg ci -Am C1 |
|
180 | $ hg ci -Am C1 | |
181 | adding c |
|
181 | adding c | |
182 |
|
182 | |||
183 | $ hg phase --force --secret 1 |
|
183 | $ hg phase --force --secret 1 | |
184 | $ hg phase --public 1 |
|
184 | $ hg phase --public 1 | |
185 |
|
185 | |||
186 | Rebase and abort without generating new changesets: |
|
186 | Rebase and abort without generating new changesets: | |
187 |
|
187 | |||
188 | $ hg tglog |
|
188 | $ hg tglog | |
189 | @ 4:draft 'C1' |
|
189 | @ 4:draft 'C1' | |
190 | | |
|
190 | | | |
191 | o 3:draft 'B bis' |
|
191 | o 3:draft 'B bis' | |
192 | | |
|
192 | | | |
193 | | o 2:secret 'C' |
|
193 | | o 2:secret 'C' | |
194 | | | |
|
194 | | | | |
195 | | o 1:public 'B' |
|
195 | | o 1:public 'B' | |
196 | |/ |
|
196 | |/ | |
197 | o 0:public 'A' |
|
197 | o 0:public 'A' | |
198 |
|
198 | |||
199 | $ hg rebase -b 4 -d 2 |
|
199 | $ hg rebase -b 4 -d 2 | |
200 | rebasing 3:a6484957d6b9 "B bis" |
|
200 | rebasing 3:a6484957d6b9 "B bis" | |
201 | note: rebase of 3:a6484957d6b9 created no changes to commit |
|
201 | note: rebase of 3:a6484957d6b9 created no changes to commit | |
202 | rebasing 4:145842775fec "C1" (tip) |
|
202 | rebasing 4:145842775fec "C1" (tip) | |
203 | merging c |
|
203 | merging c | |
204 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
204 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | |
205 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
205 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
206 | [1] |
|
206 | [1] | |
207 |
|
207 | |||
208 | $ hg tglog |
|
208 | $ hg tglog | |
209 | @ 4:draft 'C1' |
|
209 | @ 4:draft 'C1' | |
210 | | |
|
210 | | | |
211 | o 3:draft 'B bis' |
|
211 | o 3:draft 'B bis' | |
212 | | |
|
212 | | | |
213 | | @ 2:secret 'C' |
|
213 | | @ 2:secret 'C' | |
214 | | | |
|
214 | | | | |
215 | | o 1:public 'B' |
|
215 | | o 1:public 'B' | |
216 | |/ |
|
216 | |/ | |
217 | o 0:public 'A' |
|
217 | o 0:public 'A' | |
218 |
|
218 | |||
219 | $ hg rebase -a |
|
219 | $ hg rebase -a | |
220 | rebase aborted |
|
220 | rebase aborted | |
221 |
|
221 | |||
222 | $ hg tglog |
|
222 | $ hg tglog | |
223 | @ 4:draft 'C1' |
|
223 | @ 4:draft 'C1' | |
224 | | |
|
224 | | | |
225 | o 3:draft 'B bis' |
|
225 | o 3:draft 'B bis' | |
226 | | |
|
226 | | | |
227 | | o 2:secret 'C' |
|
227 | | o 2:secret 'C' | |
228 | | | |
|
228 | | | | |
229 | | o 1:public 'B' |
|
229 | | o 1:public 'B' | |
230 | |/ |
|
230 | |/ | |
231 | o 0:public 'A' |
|
231 | o 0:public 'A' | |
232 |
|
232 | |||
233 |
|
233 | |||
234 | $ cd .. |
|
234 | $ cd .. | |
235 |
|
235 | |||
236 | rebase abort should not leave working copy in a merge state if tip-1 is public |
|
236 | rebase abort should not leave working copy in a merge state if tip-1 is public | |
237 | (issue4082) |
|
237 | (issue4082) | |
238 |
|
238 | |||
239 | $ hg init abortpublic |
|
239 | $ hg init abortpublic | |
240 | $ cd abortpublic |
|
240 | $ cd abortpublic | |
241 | $ echo a > a && hg ci -Aqm a |
|
241 | $ echo a > a && hg ci -Aqm a | |
242 | $ hg book master |
|
242 | $ hg book master | |
243 | $ hg book foo |
|
243 | $ hg book foo | |
244 | $ echo b > b && hg ci -Aqm b |
|
244 | $ echo b > b && hg ci -Aqm b | |
245 | $ hg up -q master |
|
245 | $ hg up -q master | |
246 | $ echo c > c && hg ci -Aqm c |
|
246 | $ echo c > c && hg ci -Aqm c | |
247 | $ hg phase -p -r . |
|
247 | $ hg phase -p -r . | |
248 | $ hg up -q foo |
|
248 | $ hg up -q foo | |
249 | $ echo C > c && hg ci -Aqm C |
|
249 | $ echo C > c && hg ci -Aqm C | |
250 | $ hg log -G --template "{rev} {desc} {bookmarks}" |
|
250 | $ hg log -G --template "{rev} {desc} {bookmarks}" | |
251 | @ 3 C foo |
|
251 | @ 3 C foo | |
252 | | |
|
252 | | | |
253 | | o 2 c master |
|
253 | | o 2 c master | |
254 | | | |
|
254 | | | | |
255 | o | 1 b |
|
255 | o | 1 b | |
256 | |/ |
|
256 | |/ | |
257 | o 0 a |
|
257 | o 0 a | |
258 |
|
258 | |||
259 |
|
259 | |||
260 | $ hg rebase -d master -r foo |
|
260 | $ hg rebase -d master -r foo | |
261 | rebasing 3:6c0f977a22d8 "C" (tip foo) |
|
261 | rebasing 3:6c0f977a22d8 "C" (tip foo) | |
262 | merging c |
|
262 | merging c | |
263 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
|
263 | warning: conflicts while merging c! (edit, then use 'hg resolve --mark') | |
264 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
264 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
265 | [1] |
|
265 | [1] | |
266 | $ hg rebase --abort |
|
266 | $ hg rebase --abort | |
267 | rebase aborted |
|
267 | rebase aborted | |
268 | $ hg log -G --template "{rev} {desc} {bookmarks}" |
|
268 | $ hg log -G --template "{rev} {desc} {bookmarks}" | |
269 | @ 3 C foo |
|
269 | @ 3 C foo | |
270 | | |
|
270 | | | |
271 | | o 2 c master |
|
271 | | o 2 c master | |
272 | | | |
|
272 | | | | |
273 | o | 1 b |
|
273 | o | 1 b | |
274 | |/ |
|
274 | |/ | |
275 | o 0 a |
|
275 | o 0 a | |
276 |
|
276 | |||
277 | $ cd .. |
|
277 | $ cd .. | |
278 |
|
278 | |||
279 | Make sure we don't clobber changes in the working directory when the |
|
279 | Make sure we don't clobber changes in the working directory when the | |
280 | user has somehow managed to update to a different revision (issue4009) |
|
280 | user has somehow managed to update to a different revision (issue4009) | |
281 |
|
281 | |||
282 | $ hg init noupdate |
|
282 | $ hg init noupdate | |
283 | $ cd noupdate |
|
283 | $ cd noupdate | |
284 | $ hg book @ |
|
284 | $ hg book @ | |
285 | $ echo original > a |
|
285 | $ echo original > a | |
286 | $ hg add a |
|
286 | $ hg add a | |
287 | $ hg commit -m a |
|
287 | $ hg commit -m a | |
288 | $ echo x > b |
|
288 | $ echo x > b | |
289 | $ hg add b |
|
289 | $ hg add b | |
290 | $ hg commit -m b1 |
|
290 | $ hg commit -m b1 | |
291 | $ hg up 0 |
|
291 | $ hg up 0 | |
292 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
292 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
293 | (leaving bookmark @) |
|
293 | (leaving bookmark @) | |
294 | $ hg book foo |
|
294 | $ hg book foo | |
295 | $ echo y > b |
|
295 | $ echo y > b | |
296 | $ hg add b |
|
296 | $ hg add b | |
297 | $ hg commit -m b2 |
|
297 | $ hg commit -m b2 | |
298 | created new head |
|
298 | created new head | |
299 |
|
299 | |||
300 | $ hg rebase -d @ -b foo --tool=internal:fail |
|
300 | $ hg rebase -d @ -b foo --tool=internal:fail | |
301 | rebasing 2:070cf4580bb5 "b2" (tip foo) |
|
301 | rebasing 2:070cf4580bb5 "b2" (tip foo) | |
302 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
302 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
303 | [1] |
|
303 | [1] | |
304 |
|
304 | |||
305 | $ mv .hg/rebasestate ./ # so we're allowed to hg up like in mercurial <2.6.3 |
|
305 | $ mv .hg/rebasestate ./ # so we're allowed to hg up like in mercurial <2.6.3 | |
306 | $ hg up -C 0 # user does other stuff in the repo |
|
306 | $ hg up -C 0 # user does other stuff in the repo | |
307 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
307 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
308 |
|
308 | |||
309 | $ mv rebasestate .hg/ # user upgrades to 2.7 |
|
309 | $ mv rebasestate .hg/ # user upgrades to 2.7 | |
310 |
|
310 | |||
311 | $ echo new > a |
|
311 | $ echo new > a | |
312 | $ hg up 1 # user gets an error saying to run hg rebase --abort |
|
312 | $ hg up 1 # user gets an error saying to run hg rebase --abort | |
313 | abort: rebase in progress |
|
313 | abort: rebase in progress | |
314 | (use 'hg rebase --continue' or 'hg rebase --abort') |
|
314 | (use 'hg rebase --continue' or 'hg rebase --abort') | |
315 | [255] |
|
315 | [255] | |
316 |
|
316 | |||
317 | $ cat a |
|
317 | $ cat a | |
318 | new |
|
318 | new | |
319 | $ hg rebase --abort |
|
319 | $ hg rebase --abort | |
320 | rebase aborted |
|
320 | rebase aborted | |
321 | $ cat a |
|
321 | $ cat a | |
322 | new |
|
322 | new | |
323 |
|
323 | |||
324 | $ cd .. |
|
324 | $ cd .. | |
325 |
|
325 | |||
326 | On the other hand, make sure we *do* clobber changes whenever we |
|
326 | On the other hand, make sure we *do* clobber changes whenever we | |
327 | haven't somehow managed to update the repo to a different revision |
|
327 | haven't somehow managed to update the repo to a different revision | |
328 | during a rebase (issue4661) |
|
328 | during a rebase (issue4661) | |
329 |
|
329 | |||
330 | $ hg ini yesupdate |
|
330 | $ hg ini yesupdate | |
331 | $ cd yesupdate |
|
331 | $ cd yesupdate | |
332 | $ echo "initial data" > foo.txt |
|
332 | $ echo "initial data" > foo.txt | |
333 | $ hg add |
|
333 | $ hg add | |
334 | adding foo.txt |
|
334 | adding foo.txt | |
335 | $ hg ci -m "initial checkin" |
|
335 | $ hg ci -m "initial checkin" | |
336 | $ echo "change 1" > foo.txt |
|
336 | $ echo "change 1" > foo.txt | |
337 | $ hg ci -m "change 1" |
|
337 | $ hg ci -m "change 1" | |
338 | $ hg up 0 |
|
338 | $ hg up 0 | |
339 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
339 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
340 | $ echo "conflicting change 1" > foo.txt |
|
340 | $ echo "conflicting change 1" > foo.txt | |
341 | $ hg ci -m "conflicting 1" |
|
341 | $ hg ci -m "conflicting 1" | |
342 | created new head |
|
342 | created new head | |
343 | $ echo "conflicting change 2" > foo.txt |
|
343 | $ echo "conflicting change 2" > foo.txt | |
344 | $ hg ci -m "conflicting 2" |
|
344 | $ hg ci -m "conflicting 2" | |
345 |
|
345 | |||
346 | $ hg rebase -d 1 --tool 'internal:fail' |
|
346 | $ hg rebase -d 1 --tool 'internal:fail' | |
347 | rebasing 2:e4ea5cdc9789 "conflicting 1" |
|
347 | rebasing 2:e4ea5cdc9789 "conflicting 1" | |
348 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
348 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
349 | [1] |
|
349 | [1] | |
350 | $ hg rebase --abort |
|
350 | $ hg rebase --abort | |
351 | rebase aborted |
|
351 | rebase aborted | |
352 | $ hg summary |
|
352 | $ hg summary | |
353 | parent: 3:b16646383533 tip |
|
353 | parent: 3:b16646383533 tip | |
354 | conflicting 2 |
|
354 | conflicting 2 | |
355 | branch: default |
|
355 | branch: default | |
356 | commit: (clean) |
|
356 | commit: (clean) | |
357 | update: 1 new changesets, 2 branch heads (merge) |
|
357 | update: 1 new changesets, 2 branch heads (merge) | |
358 | phases: 4 draft |
|
358 | phases: 4 draft | |
|
359 | $ cd .. | |||
359 |
|
360 | |||
360 | test aborting a rebase succeeds after rebasing with skipped commits onto a |
|
361 | test aborting a rebase succeeds after rebasing with skipped commits onto a | |
361 | public changeset (issue4896) |
|
362 | public changeset (issue4896) | |
362 |
|
363 | |||
363 | $ hg init succeedonpublic |
|
364 | $ hg init succeedonpublic | |
364 | $ cd succeedonpublic |
|
365 | $ cd succeedonpublic | |
365 | $ echo 'content' > root |
|
366 | $ echo 'content' > root | |
366 | $ hg commit -A -m 'root' -q |
|
367 | $ hg commit -A -m 'root' -q | |
367 |
|
368 | |||
368 | set up public branch |
|
369 | set up public branch | |
369 | $ echo 'content' > disappear |
|
370 | $ echo 'content' > disappear | |
370 | $ hg commit -A -m 'disappear public' -q |
|
371 | $ hg commit -A -m 'disappear public' -q | |
371 | commit will cause merge conflict on rebase |
|
372 | commit will cause merge conflict on rebase | |
372 | $ echo '' > root |
|
373 | $ echo '' > root | |
373 | $ hg commit -m 'remove content public' -q |
|
374 | $ hg commit -m 'remove content public' -q | |
374 | $ hg phase --public |
|
375 | $ hg phase --public | |
375 |
|
376 | |||
376 | setup the draft branch that will be rebased onto public commit |
|
377 | setup the draft branch that will be rebased onto public commit | |
377 | $ hg up -r 0 -q |
|
378 | $ hg up -r 0 -q | |
378 | $ echo 'content' > disappear |
|
379 | $ echo 'content' > disappear | |
379 | commit will disappear |
|
380 | commit will disappear | |
380 | $ hg commit -A -m 'disappear draft' -q |
|
381 | $ hg commit -A -m 'disappear draft' -q | |
381 | $ echo 'addedcontADDEDentadded' > root |
|
382 | $ echo 'addedcontADDEDentadded' > root | |
382 | commit will cause merge conflict on rebase |
|
383 | commit will cause merge conflict on rebase | |
383 | $ hg commit -m 'add content draft' -q |
|
384 | $ hg commit -m 'add content draft' -q | |
384 |
|
385 | |||
385 | $ hg rebase -d 'public()' --tool :merge -q |
|
386 | $ hg rebase -d 'public()' --tool :merge -q | |
386 | note: rebase of 3:0682fd3dabf5 created no changes to commit |
|
387 | note: rebase of 3:0682fd3dabf5 created no changes to commit | |
387 | warning: conflicts while merging root! (edit, then use 'hg resolve --mark') |
|
388 | warning: conflicts while merging root! (edit, then use 'hg resolve --mark') | |
388 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
389 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
389 | [1] |
|
390 | [1] | |
390 | $ hg rebase --abort |
|
391 | $ hg rebase --abort | |
391 | rebase aborted |
|
392 | rebase aborted | |
|
393 | $ cd .. | |||
392 |
|
394 |
General Comments 0
You need to be logged in to leave comments.
Login now