##// END OF EJS Templates
tests: demonstrate inconsistent messaging around interrupted rebases
Matt Harbison -
r38219:712d6f53 stable
parent child Browse files
Show More
@@ -1,474 +1,505 b''
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 labels:
78 labels:
79 local: dest
79 local: dest
80 other: source
80 other: source
81 unrecognized entry: x advisory record
81 unrecognized entry: x advisory record
82 file extras: common (ancestorlinknode = 3163e20567cc93074fbb7a53c8b93312e59dbf2c)
82 file extras: common (ancestorlinknode = 3163e20567cc93074fbb7a53c8b93312e59dbf2c)
83 file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1)
83 file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1)
84 local path: common (flags "")
84 local path: common (flags "")
85 ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6)
85 ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6)
86 other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5)
86 other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5)
87 $ hg resolve -l
87 $ hg resolve -l
88 U common
88 U common
89
89
90 Insert unsupported mandatory merge record:
90 Insert unsupported mandatory merge record:
91
91
92 $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X
92 $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X
93 $ hg debugmergestate
93 $ hg debugmergestate
94 * version 2 records
94 * version 2 records
95 local: 3e046f2ecedb793b97ed32108086edd1a162f8bc
95 local: 3e046f2ecedb793b97ed32108086edd1a162f8bc
96 other: 46f0b057b5c061d276b91491c22151f78698abd2
96 other: 46f0b057b5c061d276b91491c22151f78698abd2
97 labels:
97 labels:
98 local: dest
98 local: dest
99 other: source
99 other: source
100 file extras: common (ancestorlinknode = 3163e20567cc93074fbb7a53c8b93312e59dbf2c)
100 file extras: common (ancestorlinknode = 3163e20567cc93074fbb7a53c8b93312e59dbf2c)
101 file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1)
101 file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1)
102 local path: common (flags "")
102 local path: common (flags "")
103 ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6)
103 ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6)
104 other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5)
104 other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5)
105 unrecognized entry: X mandatory record
105 unrecognized entry: X mandatory record
106 $ hg resolve -l
106 $ hg resolve -l
107 abort: unsupported merge state records: X
107 abort: unsupported merge state records: X
108 (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
108 (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
109 [255]
109 [255]
110 $ hg resolve -ma
110 $ hg resolve -ma
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
114
115 Abort (should clear out unsupported merge state):
115 Abort (should clear out unsupported merge state):
116
116
117 $ hg rebase --abort
117 $ hg rebase --abort
118 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3e046f2ecedb-6beef7d5-backup.hg
118 saved backup bundle to $TESTTMP/a/.hg/strip-backup/3e046f2ecedb-6beef7d5-backup.hg
119 rebase aborted
119 rebase aborted
120 $ hg debugmergestate
120 $ hg debugmergestate
121 no merge state found
121 no merge state found
122
122
123 $ hg tglog
123 $ hg tglog
124 @ 4:draft 'L2'
124 @ 4:draft 'L2'
125 |
125 |
126 o 3:draft 'L1'
126 o 3:draft 'L1'
127 |
127 |
128 | o 2:secret 'C3'
128 | o 2:secret 'C3'
129 |/
129 |/
130 o 1:draft 'C2'
130 o 1:draft 'C2'
131 |
131 |
132 o 0:draft 'C1'
132 o 0:draft 'C1'
133
133
134 Test safety for inconsistent rebase state, which may be created (and
134 Test safety for inconsistent rebase state, which may be created (and
135 forgotten) by Mercurial earlier than 2.7. This emulates Mercurial
135 forgotten) by Mercurial earlier than 2.7. This emulates Mercurial
136 earlier than 2.7 by renaming ".hg/rebasestate" temporarily.
136 earlier than 2.7 by renaming ".hg/rebasestate" temporarily.
137
137
138 $ hg rebase -s 3 -d 2
138 $ hg rebase -s 3 -d 2
139 rebasing 3:3163e20567cc "L1"
139 rebasing 3:3163e20567cc "L1"
140 rebasing 4:46f0b057b5c0 "L2" (tip)
140 rebasing 4:46f0b057b5c0 "L2" (tip)
141 merging common
141 merging common
142 warning: conflicts while merging common! (edit, then use 'hg resolve --mark')
142 warning: conflicts while merging common! (edit, then use 'hg resolve --mark')
143 unresolved conflicts (see hg resolve, then hg rebase --continue)
143 unresolved conflicts (see hg resolve, then hg rebase --continue)
144 [1]
144 [1]
145
145
146 $ mv .hg/rebasestate .hg/rebasestate.back
146 $ mv .hg/rebasestate .hg/rebasestate.back
147 $ hg update --quiet --clean 2
147 $ hg update --quiet --clean 2
148 $ hg --config extensions.mq= strip --quiet "destination()"
148 $ hg --config extensions.mq= strip --quiet "destination()"
149 $ mv .hg/rebasestate.back .hg/rebasestate
149 $ mv .hg/rebasestate.back .hg/rebasestate
150
150
151 $ hg rebase --continue
151 $ hg rebase --continue
152 abort: cannot continue inconsistent rebase
152 abort: cannot continue inconsistent rebase
153 (use "hg rebase --abort" to clear broken state)
153 (use "hg rebase --abort" to clear broken state)
154 [255]
154 [255]
155 $ hg summary | grep '^rebase: '
155 $ hg summary | grep '^rebase: '
156 rebase: (use "hg rebase --abort" to clear broken state)
156 rebase: (use "hg rebase --abort" to clear broken state)
157 $ hg rebase --abort
157 $ hg rebase --abort
158 rebase aborted (no revision is removed, only broken state is cleared)
158 rebase aborted (no revision is removed, only broken state is cleared)
159
159
160 $ cd ..
160 $ cd ..
161
161
162
162
163 Construct new repo:
163 Construct new repo:
164
164
165 $ hg init b
165 $ hg init b
166 $ cd b
166 $ cd b
167
167
168 $ echo a > a
168 $ echo a > a
169 $ hg ci -Am A
169 $ hg ci -Am A
170 adding a
170 adding a
171
171
172 $ echo b > b
172 $ echo b > b
173 $ hg ci -Am B
173 $ hg ci -Am B
174 adding b
174 adding b
175
175
176 $ echo c > c
176 $ echo c > c
177 $ hg ci -Am C
177 $ hg ci -Am C
178 adding c
178 adding c
179
179
180 $ hg up -q 0
180 $ hg up -q 0
181
181
182 $ echo b > b
182 $ echo b > b
183 $ hg ci -Am 'B bis'
183 $ hg ci -Am 'B bis'
184 adding b
184 adding b
185 created new head
185 created new head
186
186
187 $ echo c1 > c
187 $ echo c1 > c
188 $ hg ci -Am C1
188 $ hg ci -Am C1
189 adding c
189 adding c
190
190
191 $ hg phase --force --secret 1
191 $ hg phase --force --secret 1
192 $ hg phase --public 1
192 $ hg phase --public 1
193
193
194 Rebase and abort without generating new changesets:
194 Rebase and abort without generating new changesets:
195
195
196 $ hg tglog
196 $ hg tglog
197 @ 4:draft 'C1'
197 @ 4:draft 'C1'
198 |
198 |
199 o 3:draft 'B bis'
199 o 3:draft 'B bis'
200 |
200 |
201 | o 2:secret 'C'
201 | o 2:secret 'C'
202 | |
202 | |
203 | o 1:public 'B'
203 | o 1:public 'B'
204 |/
204 |/
205 o 0:public 'A'
205 o 0:public 'A'
206
206
207 $ hg rebase -b 4 -d 2
207 $ hg rebase -b 4 -d 2
208 rebasing 3:a6484957d6b9 "B bis"
208 rebasing 3:a6484957d6b9 "B bis"
209 note: rebase of 3:a6484957d6b9 created no changes to commit
209 note: rebase of 3:a6484957d6b9 created no changes to commit
210 rebasing 4:145842775fec "C1" (tip)
210 rebasing 4:145842775fec "C1" (tip)
211 merging c
211 merging c
212 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
212 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
213 unresolved conflicts (see hg resolve, then hg rebase --continue)
213 unresolved conflicts (see hg resolve, then hg rebase --continue)
214 [1]
214 [1]
215
215
216 $ hg tglog
216 $ hg tglog
217 @ 4:draft 'C1'
217 @ 4:draft 'C1'
218 |
218 |
219 o 3:draft 'B bis'
219 o 3:draft 'B bis'
220 |
220 |
221 | @ 2:secret 'C'
221 | @ 2:secret 'C'
222 | |
222 | |
223 | o 1:public 'B'
223 | o 1:public 'B'
224 |/
224 |/
225 o 0:public 'A'
225 o 0:public 'A'
226
226
227 $ hg rebase -a
227 $ hg rebase -a
228 rebase aborted
228 rebase aborted
229
229
230 $ hg tglog
230 $ hg tglog
231 @ 4:draft 'C1'
231 @ 4:draft 'C1'
232 |
232 |
233 o 3:draft 'B bis'
233 o 3:draft 'B bis'
234 |
234 |
235 | o 2:secret 'C'
235 | o 2:secret 'C'
236 | |
236 | |
237 | o 1:public 'B'
237 | o 1:public 'B'
238 |/
238 |/
239 o 0:public 'A'
239 o 0:public 'A'
240
240
241
241
242 $ cd ..
242 $ cd ..
243
243
244 rebase abort should not leave working copy in a merge state if tip-1 is public
244 rebase abort should not leave working copy in a merge state if tip-1 is public
245 (issue4082)
245 (issue4082)
246
246
247 $ hg init abortpublic
247 $ hg init abortpublic
248 $ cd abortpublic
248 $ cd abortpublic
249 $ echo a > a && hg ci -Aqm a
249 $ echo a > a && hg ci -Aqm a
250 $ hg book master
250 $ hg book master
251 $ hg book foo
251 $ hg book foo
252 $ echo b > b && hg ci -Aqm b
252 $ echo b > b && hg ci -Aqm b
253 $ hg up -q master
253 $ hg up -q master
254 $ echo c > c && hg ci -Aqm c
254 $ echo c > c && hg ci -Aqm c
255 $ hg phase -p -r .
255 $ hg phase -p -r .
256 $ hg up -q foo
256 $ hg up -q foo
257 $ echo C > c && hg ci -Aqm C
257 $ echo C > c && hg ci -Aqm C
258 $ hg log -G --template "{rev} {desc} {bookmarks}"
258 $ hg log -G --template "{rev} {desc} {bookmarks}"
259 @ 3 C foo
259 @ 3 C foo
260 |
260 |
261 | o 2 c master
261 | o 2 c master
262 | |
262 | |
263 o | 1 b
263 o | 1 b
264 |/
264 |/
265 o 0 a
265 o 0 a
266
266
267
267
268 $ hg rebase -d master -r foo
268 $ hg rebase -d master -r foo
269 rebasing 3:6c0f977a22d8 "C" (foo tip)
269 rebasing 3:6c0f977a22d8 "C" (foo tip)
270 merging c
270 merging c
271 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
271 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
272 unresolved conflicts (see hg resolve, then hg rebase --continue)
272 unresolved conflicts (see hg resolve, then hg rebase --continue)
273 [1]
273 [1]
274 $ hg rebase --abort
274 $ hg rebase --abort
275 rebase aborted
275 rebase aborted
276 $ hg log -G --template "{rev} {desc} {bookmarks}"
276 $ hg log -G --template "{rev} {desc} {bookmarks}"
277 @ 3 C foo
277 @ 3 C foo
278 |
278 |
279 | o 2 c master
279 | o 2 c master
280 | |
280 | |
281 o | 1 b
281 o | 1 b
282 |/
282 |/
283 o 0 a
283 o 0 a
284
284
285 $ cd ..
285 $ cd ..
286
286
287 Make sure we don't clobber changes in the working directory when the
287 Make sure we don't clobber changes in the working directory when the
288 user has somehow managed to update to a different revision (issue4009)
288 user has somehow managed to update to a different revision (issue4009)
289
289
290 $ hg init noupdate
290 $ hg init noupdate
291 $ cd noupdate
291 $ cd noupdate
292 $ hg book @
292 $ hg book @
293 $ echo original > a
293 $ echo original > a
294 $ hg add a
294 $ hg add a
295 $ hg commit -m a
295 $ hg commit -m a
296 $ echo x > b
296 $ echo x > b
297 $ hg add b
297 $ hg add b
298 $ hg commit -m b1
298 $ hg commit -m b1
299 $ hg up 0
299 $ hg up 0
300 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
300 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
301 (leaving bookmark @)
301 (leaving bookmark @)
302 $ hg book foo
302 $ hg book foo
303 $ echo y > b
303 $ echo y > b
304 $ hg add b
304 $ hg add b
305 $ hg commit -m b2
305 $ hg commit -m b2
306 created new head
306 created new head
307
307
308 $ hg rebase -d @ -b foo --tool=internal:fail
308 $ hg rebase -d @ -b foo --tool=internal:fail
309 rebasing 2:070cf4580bb5 "b2" (foo tip)
309 rebasing 2:070cf4580bb5 "b2" (foo tip)
310 unresolved conflicts (see hg resolve, then hg rebase --continue)
310 unresolved conflicts (see hg resolve, then hg rebase --continue)
311 [1]
311 [1]
312
312
313 $ mv .hg/rebasestate ./ # so we're allowed to hg up like in mercurial <2.6.3
313 $ mv .hg/rebasestate ./ # so we're allowed to hg up like in mercurial <2.6.3
314 $ hg up -C 0 # user does other stuff in the repo
314 $ hg up -C 0 # user does other stuff in the repo
315 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
315 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
316
316
317 $ mv rebasestate .hg/ # user upgrades to 2.7
317 $ mv rebasestate .hg/ # user upgrades to 2.7
318
318
319 $ echo new > a
319 $ echo new > a
320 $ hg up 1 # user gets an error saying to run hg rebase --abort
320 $ hg up 1 # user gets an error saying to run hg rebase --abort
321 abort: rebase in progress
321 abort: rebase in progress
322 (use 'hg rebase --continue' or 'hg rebase --abort')
322 (use 'hg rebase --continue' or 'hg rebase --abort')
323 [255]
323 [255]
324
324
325 $ cat a
325 $ cat a
326 new
326 new
327 $ hg rebase --abort
327 $ hg rebase --abort
328 rebase aborted
328 rebase aborted
329 $ cat a
329 $ cat a
330 new
330 new
331
331
332 $ cd ..
332 $ cd ..
333
333
334 test aborting an interrupted series (issue5084)
334 test aborting an interrupted series (issue5084)
335 $ hg init interrupted
335 $ hg init interrupted
336 $ cd interrupted
336 $ cd interrupted
337 $ touch base
337 $ touch base
338 $ hg add base
338 $ hg add base
339 $ hg commit -m base
339 $ hg commit -m base
340 $ touch a
340 $ touch a
341 $ hg add a
341 $ hg add a
342 $ hg commit -m a
342 $ hg commit -m a
343 $ echo 1 > a
343 $ echo 1 > a
344 $ hg commit -m 1
344 $ hg commit -m 1
345 $ touch b
345 $ touch b
346 $ hg add b
346 $ hg add b
347 $ hg commit -m b
347 $ hg commit -m b
348 $ echo 2 >> a
348 $ echo 2 >> a
349 $ hg commit -m c
349 $ hg commit -m c
350 $ touch d
350 $ touch d
351 $ hg add d
351 $ hg add d
352 $ hg commit -m d
352 $ hg commit -m d
353 $ hg co -q 1
353 $ hg co -q 1
354 $ hg rm a
354 $ hg rm a
355 $ hg commit -m no-a
355 $ hg commit -m no-a
356 created new head
356 created new head
357 $ hg co 0
357 $ hg co 0
358 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
358 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
359 $ hg log -G --template "{rev} {desc} {bookmarks}"
359 $ hg log -G --template "{rev} {desc} {bookmarks}"
360 o 6 no-a
360 o 6 no-a
361 |
361 |
362 | o 5 d
362 | o 5 d
363 | |
363 | |
364 | o 4 c
364 | o 4 c
365 | |
365 | |
366 | o 3 b
366 | o 3 b
367 | |
367 | |
368 | o 2 1
368 | o 2 1
369 |/
369 |/
370 o 1 a
370 o 1 a
371 |
371 |
372 @ 0 base
372 @ 0 base
373
373
374 $ hg --config extensions.n=$TESTDIR/failfilemerge.py rebase -s 3 -d tip
374 $ hg --config extensions.n=$TESTDIR/failfilemerge.py rebase -s 3 -d tip
375 rebasing 3:3a71550954f1 "b"
375 rebasing 3:3a71550954f1 "b"
376 rebasing 4:e80b69427d80 "c"
376 rebasing 4:e80b69427d80 "c"
377 abort: ^C
377 abort: ^C
378 [255]
378 [255]
379
380 New operations are blocked with the correct state message
381
382 $ find .hg -name '*state' -prune | sort
383 .hg/dirstate
384 .hg/merge/state
385 .hg/rebasestate
386 .hg/undo.backup.dirstate
387 .hg/undo.dirstate
388 .hg/updatestate
389
390 XXX: This should complain about needing to abort/continue rebase
391 $ hg rebase -s 3 -d tip
392 abort: last update was interrupted
393 (use 'hg update' to get a consistent checkout)
394 [255]
395 $ hg up .
396 abort: rebase in progress
397 (use 'hg rebase --continue' or 'hg rebase --abort')
398 [255]
399 $ hg up -C .
400 abort: rebase in progress
401 (use 'hg rebase --continue' or 'hg rebase --abort')
402 [255]
403
404 XXX: This should complain about needing to abort/continue rebase
405 $ hg graft 3
406 abort: last update was interrupted
407 (use 'hg update' to get a consistent checkout)
408 [255]
409
379 $ hg rebase --abort
410 $ hg rebase --abort
380 saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/3d8812cf300d-93041a90-backup.hg
411 saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/3d8812cf300d-93041a90-backup.hg
381 rebase aborted
412 rebase aborted
382 $ hg log -G --template "{rev} {desc} {bookmarks}"
413 $ hg log -G --template "{rev} {desc} {bookmarks}"
383 o 6 no-a
414 o 6 no-a
384 |
415 |
385 | o 5 d
416 | o 5 d
386 | |
417 | |
387 | o 4 c
418 | o 4 c
388 | |
419 | |
389 | o 3 b
420 | o 3 b
390 | |
421 | |
391 | o 2 1
422 | o 2 1
392 |/
423 |/
393 o 1 a
424 o 1 a
394 |
425 |
395 @ 0 base
426 @ 0 base
396
427
397 $ hg summary
428 $ hg summary
398 parent: 0:df4f53cec30a
429 parent: 0:df4f53cec30a
399 base
430 base
400 branch: default
431 branch: default
401 commit: (clean)
432 commit: (clean)
402 update: 6 new changesets (update)
433 update: 6 new changesets (update)
403 phases: 7 draft
434 phases: 7 draft
404
435
405 $ cd ..
436 $ cd ..
406 On the other hand, make sure we *do* clobber changes whenever we
437 On the other hand, make sure we *do* clobber changes whenever we
407 haven't somehow managed to update the repo to a different revision
438 haven't somehow managed to update the repo to a different revision
408 during a rebase (issue4661)
439 during a rebase (issue4661)
409
440
410 $ hg ini yesupdate
441 $ hg ini yesupdate
411 $ cd yesupdate
442 $ cd yesupdate
412 $ echo "initial data" > foo.txt
443 $ echo "initial data" > foo.txt
413 $ hg add
444 $ hg add
414 adding foo.txt
445 adding foo.txt
415 $ hg ci -m "initial checkin"
446 $ hg ci -m "initial checkin"
416 $ echo "change 1" > foo.txt
447 $ echo "change 1" > foo.txt
417 $ hg ci -m "change 1"
448 $ hg ci -m "change 1"
418 $ hg up 0
449 $ hg up 0
419 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
450 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
420 $ echo "conflicting change 1" > foo.txt
451 $ echo "conflicting change 1" > foo.txt
421 $ hg ci -m "conflicting 1"
452 $ hg ci -m "conflicting 1"
422 created new head
453 created new head
423 $ echo "conflicting change 2" > foo.txt
454 $ echo "conflicting change 2" > foo.txt
424 $ hg ci -m "conflicting 2"
455 $ hg ci -m "conflicting 2"
425
456
426 $ hg rebase -d 1 --tool 'internal:fail'
457 $ hg rebase -d 1 --tool 'internal:fail'
427 rebasing 2:e4ea5cdc9789 "conflicting 1"
458 rebasing 2:e4ea5cdc9789 "conflicting 1"
428 unresolved conflicts (see hg resolve, then hg rebase --continue)
459 unresolved conflicts (see hg resolve, then hg rebase --continue)
429 [1]
460 [1]
430 $ hg rebase --abort
461 $ hg rebase --abort
431 rebase aborted
462 rebase aborted
432 $ hg summary
463 $ hg summary
433 parent: 3:b16646383533 tip
464 parent: 3:b16646383533 tip
434 conflicting 2
465 conflicting 2
435 branch: default
466 branch: default
436 commit: (clean)
467 commit: (clean)
437 update: 1 new changesets, 2 branch heads (merge)
468 update: 1 new changesets, 2 branch heads (merge)
438 phases: 4 draft
469 phases: 4 draft
439 $ cd ..
470 $ cd ..
440
471
441 test aborting a rebase succeeds after rebasing with skipped commits onto a
472 test aborting a rebase succeeds after rebasing with skipped commits onto a
442 public changeset (issue4896)
473 public changeset (issue4896)
443
474
444 $ hg init succeedonpublic
475 $ hg init succeedonpublic
445 $ cd succeedonpublic
476 $ cd succeedonpublic
446 $ echo 'content' > root
477 $ echo 'content' > root
447 $ hg commit -A -m 'root' -q
478 $ hg commit -A -m 'root' -q
448
479
449 set up public branch
480 set up public branch
450 $ echo 'content' > disappear
481 $ echo 'content' > disappear
451 $ hg commit -A -m 'disappear public' -q
482 $ hg commit -A -m 'disappear public' -q
452 commit will cause merge conflict on rebase
483 commit will cause merge conflict on rebase
453 $ echo '' > root
484 $ echo '' > root
454 $ hg commit -m 'remove content public' -q
485 $ hg commit -m 'remove content public' -q
455 $ hg phase --public
486 $ hg phase --public
456
487
457 setup the draft branch that will be rebased onto public commit
488 setup the draft branch that will be rebased onto public commit
458 $ hg up -r 0 -q
489 $ hg up -r 0 -q
459 $ echo 'content' > disappear
490 $ echo 'content' > disappear
460 commit will disappear
491 commit will disappear
461 $ hg commit -A -m 'disappear draft' -q
492 $ hg commit -A -m 'disappear draft' -q
462 $ echo 'addedcontADDEDentadded' > root
493 $ echo 'addedcontADDEDentadded' > root
463 commit will cause merge conflict on rebase
494 commit will cause merge conflict on rebase
464 $ hg commit -m 'add content draft' -q
495 $ hg commit -m 'add content draft' -q
465
496
466 $ hg rebase -d 'public()' --tool :merge -q
497 $ hg rebase -d 'public()' --tool :merge -q
467 note: rebase of 3:0682fd3dabf5 created no changes to commit
498 note: rebase of 3:0682fd3dabf5 created no changes to commit
468 warning: conflicts while merging root! (edit, then use 'hg resolve --mark')
499 warning: conflicts while merging root! (edit, then use 'hg resolve --mark')
469 unresolved conflicts (see hg resolve, then hg rebase --continue)
500 unresolved conflicts (see hg resolve, then hg rebase --continue)
470 [1]
501 [1]
471 $ hg rebase --abort
502 $ hg rebase --abort
472 rebase aborted
503 rebase aborted
473 $ cd ..
504 $ cd ..
474
505
General Comments 0
You need to be logged in to leave comments. Login now