Mercurial > hg
changeset 18509:21daee53c101 stable
test-histedit: add tests for dropping head changeset
I got bug report from user in this specific case. I was unable to reproduce in
test situation. Testing this situation is still valuable.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Tue, 22 Jan 2013 14:33:17 +0100 |
parents | 813b7a1f7036 |
children | f254ab6207ae |
files | tests/test-histedit-drop.t tests/test-histedit-obsolete.t |
diffstat | 2 files changed, 82 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-histedit-drop.t Thu Jan 31 02:39:55 2013 +0100 +++ b/tests/test-histedit-drop.t Tue Jan 22 14:33:17 2013 +0100 @@ -123,4 +123,36 @@ e f +Drop the last changeset + + $ cat > $EDITED <<EOF + > pick ee283cb5f2d5 e + > pick a4f7421b80f7 f + > drop f518305ce889 d + > EOF + $ HGEDITOR="cat \"$EDITED\" > " hg histedit ee283cb5f2d5 2>&1 | fixbundle + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg log --graph + @ changeset: 3:a4f7421b80f7 + | tag: tip + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: f + | + o changeset: 2:ee283cb5f2d5 + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: e + | + o changeset: 1:d2ae7f538514 + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: b + | + o changeset: 0:cb9a9f314b8b + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: a + + $ cd ..
--- a/tests/test-histedit-obsolete.t Thu Jan 31 02:39:55 2013 +0100 +++ b/tests/test-histedit-obsolete.t Tue Jan 22 14:33:17 2013 +0100 @@ -153,6 +153,56 @@ $ hg rebase -r 'unstable()' -d . +Test dropping of changeset on the top of the stack +------------------------------------------------------- + +Nothing is rewritten below, the working directory parent must be change for the +dropped changeset to be hidden. + + $ cd .. + $ hg clone base droplast + updating to branch default + 3 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd droplast + $ cat > commands.txt <<EOF + > pick 40db8afa467b 10 c + > drop b449568bf7fc 11 f + > EOF + $ hg histedit -r '40db8afa467b' --commands commands.txt + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg log -G + @ 10:40db8afa467b c + | + o 0:cb9a9f314b8b a + + +With rewritten ancestors + + $ echo e > e + $ hg add e + $ hg commit -m g + $ echo f > f + $ hg add f + $ hg commit -m h + $ cat > commands.txt <<EOF + > pick 47a8561c0449 12 g + > pick 40db8afa467b 10 c + > drop 1b3b05f35ff0 13 h + > EOF + $ hg histedit -r '40db8afa467b' --commands commands.txt + 0 files updated, 0 files merged, 3 files removed, 0 files unresolved + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg log -G + @ 15:ee6544123ab8 c + | + o 14:269e713e9eae g + | + o 0:cb9a9f314b8b a + + $ cd ../base + + Test phases support ===========================================