comparison tests/test-rebase-interruptions.t @ 44665:e89b3603d3da

tests: demonstrate how continuing rebase after upgrade can result in merge If the user starts a rebase with an hg version before 9c9cfecd4600 (rebase: don't use rebased node as dirstate p2 (BC), 2020-01-10) and then runs into conflicts, they will be dropped out to the shell with the rebased node set as the dirstate's second parent. If they then upgrade to a later hg version, it will respect the dirstate's parents and will create a merge commit even if the user was rebasing a non-merge commit. Differential Revision: https://phab.mercurial-scm.org/D8355
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 01 Apr 2020 13:27:28 -0700
parents 9c9cfecd4600
children e7af56a0733e
comparison
equal deleted inserted replaced
44664:8c66a680f396 44665:e89b3603d3da
277 1 files updated, 0 files merged, 1 files removed, 0 files unresolved 277 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
278 $ echo F > F 278 $ echo F > F
279 $ hg add F 279 $ hg add F
280 $ hg ci -m F 280 $ hg ci -m F
281 281
282 $ cd ..
283
284 Continue rebase after upgrading from an hg version before 9c9cfecd4600:
285
286 $ hg clone -q -u . a a4
287 $ cd a4
288
289 $ hg tglog
290 @ 4: ae36e8e3dfd7 'E'
291 |
292 o 3: 46b37eabc604 'D'
293 |
294 | o 2: 965c486023db 'C'
295 | |
296 | o 1: 27547f69f254 'B'
297 |/
298 o 0: 4a2df7238c3b 'A'
299
300 $ hg rebase -s 1 -d 4
301 rebasing 1:27547f69f254 "B"
302 rebasing 2:965c486023db "C"
303 merging A
304 warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
305 unresolved conflicts (see hg resolve, then hg rebase --continue)
306 [1]
307 $ hg tglog
308 @ 5: 45396c49d53b 'B'
309 |
310 o 4: ae36e8e3dfd7 'E'
311 |
312 o 3: 46b37eabc604 'D'
313 |
314 | % 2: 965c486023db 'C'
315 | |
316 | o 1: 27547f69f254 'B'
317 |/
318 o 0: 4a2df7238c3b 'A'
319
320 Simulate having run the above with an older hg version by manually setting
321 two dirstate parents. We should not get a merge commit when we continue.
322 $ hg debugsetparents 5 2
323 $ echo 'conflict solved' > A
324 $ hg resolve -m A
325 (no more unresolved files)
326 continue: hg rebase --continue
327 $ hg rebase --continue
328 already rebased 1:27547f69f254 "B" as 45396c49d53b
329 rebasing 2:965c486023db "C"
330 warning: orphaned descendants detected, not stripping 27547f69f254, 965c486023db
331 BROKEN: we should not have a merge commit here
332 $ hg tglog
333 o 6: 567335b578a0 'C'
334 |\
335 | o 5: 45396c49d53b 'B'
336 | |
337 | @ 4: ae36e8e3dfd7 'E'
338 | |
339 | o 3: 46b37eabc604 'D'
340 | |
341 o | 2: 965c486023db 'C'
342 | |
343 o | 1: 27547f69f254 'B'
344 |/
345 o 0: 4a2df7238c3b 'A'
346
282 $ cd .. 347 $ cd ..
283 348
284 (precommit version) 349 (precommit version)
285 350
286 $ cp -R a3 hook-precommit 351 $ cp -R a3 hook-precommit