Mercurial > hg
comparison tests/test-rebase-abort.t @ 26677:e9b3d523f2e6
rebase: properly abort when destination is public (issue4896)
After rebasing a set of changes onto a public changeset and having the first one
be skipped, if you try to abort, the operation fails. This fix adds a check to
disallow the target rev into the dstates list within the abort function. This
list is checked for immutable states before the rest of abort does its thing.
author | Christian Delahousse <cdelahousse@fb.com> |
---|---|
date | Tue, 13 Oct 2015 14:06:51 -0700 |
parents | ef1eb6df7071 |
children | a01ecbcfaf84 |
comparison
equal
deleted
inserted
replaced
26676:71a485130beb | 26677:e9b3d523f2e6 |
---|---|
316 conflicting 2 | 316 conflicting 2 |
317 branch: default | 317 branch: default |
318 commit: (clean) | 318 commit: (clean) |
319 update: 1 new changesets, 2 branch heads (merge) | 319 update: 1 new changesets, 2 branch heads (merge) |
320 phases: 4 draft | 320 phases: 4 draft |
321 | |
322 test aborting a rebase succeeds after rebasing with skipped commits onto a | |
323 public changeset (issue4896) | |
324 | |
325 $ hg init succeedonpublic | |
326 $ cd succeedonpublic | |
327 $ echo 'content' > root | |
328 $ hg commit -A -m 'root' -q | |
329 | |
330 set up public branch | |
331 $ echo 'content' > disappear | |
332 $ hg commit -A -m 'disappear public' -q | |
333 commit will cause merge conflict on rebase | |
334 $ echo '' > root | |
335 $ hg commit -m 'remove content public' -q | |
336 $ hg phase --public | |
337 | |
338 setup the draft branch that will be rebased onto public commit | |
339 $ hg up -r 0 -q | |
340 $ echo 'content' > disappear | |
341 commit will disappear | |
342 $ hg commit -A -m 'disappear draft' -q | |
343 $ echo 'addedcontADDEDentadded' > root | |
344 commit will cause merge conflict on rebase | |
345 $ hg commit -m 'add content draft' -q | |
346 | |
347 $ hg rebase -d 'public()' --tool :merge -q | |
348 note: rebase of 3:0682fd3dabf5 created no changes to commit | |
349 warning: conflicts while merging root! (edit, then use 'hg resolve --mark') | |
350 unresolved conflicts (see hg resolve, then hg rebase --continue) | |
351 [1] | |
352 $ hg rebase --abort | |
353 rebase aborted | |
354 |