comparison tests/test-rebase-obsolete3.t @ 46830:6648307d4fe8

tests: test divergence created during interrupted rebase If a rebase runs into conflicts and the user somehow rewrites an unrebased commit in the rebase set while the rebase is interrupted, continuing it might result in divergence. It turns out that we decide to skip the commit. That seems to make sense, but it wasn't obvious to me that that's what we should do. Either way, this patch adds a test case for the current behavior. Differential Revision: https://phab.mercurial-scm.org/D10256
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 23 Mar 2021 10:12:58 -0700
parents 13b200ffe8eb
children 535de0e34a79
comparison
equal deleted inserted replaced
46829:13b200ffe8eb 46830:6648307d4fe8
280 | 280 |
281 o 0:b173517d0057 a 281 o 0:b173517d0057 a
282 282
283 $ cd .. 283 $ cd ..
284 284
285 Start a normal rebase. When it runs into conflicts, rewrite one of the
286 commits in the rebase set, causing divergence when the rebase continues.
287
288 $ hg init $TESTTMP/new-divergence-after-conflict
289 $ cd $TESTTMP/new-divergence-after-conflict
290 $ hg debugdrawdag <<'EOS'
291 > C2
292 > | C1
293 > |/
294 > B # B/D=B
295 > | D
296 > |/
297 > A
298 > EOS
299 $ hg rebase -r B::C1 -d D
300 rebasing 1:2ec65233581b B "B"
301 merging D
302 warning: conflicts while merging D! (edit, then use 'hg resolve --mark')
303 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
304 [240]
305 $ hg debugobsolete $(hg log -r C1 -T '{node}') $(hg log -r C2 -T '{node}')
306 1 new obsolescence markers
307 obsoleted 1 changesets
308 $ hg log -G
309 o 4:fdb9df6b130c C2
310 |
311 | x 3:7e5bfd3c08f0 C1 (rewritten as 4:fdb9df6b130c)
312 |/
313 | @ 2:b18e25de2cf5 D
314 | |
315 % | 1:2ec65233581b B
316 |/
317 o 0:426bada5c675 A
318
319 $ echo resolved > D
320 $ hg resolve -m D
321 (no more unresolved files)
322 continue: hg rebase --continue
323 $ hg rebase -c
324 rebasing 1:2ec65233581b B "B"
325 note: not rebasing 3:7e5bfd3c08f0 C1 "C1" and its descendants as this would cause divergence
326 1 new orphan changesets
327
285 Rebase merge where successor of one parent is equal to destination (issue5198) 328 Rebase merge where successor of one parent is equal to destination (issue5198)
286 329
287 $ hg init p1-succ-is-dest 330 $ hg init p1-succ-is-dest
288 $ cd p1-succ-is-dest 331 $ cd p1-succ-is-dest
289 332