# HG changeset patch # User Thomas Arendsen Hein # Date 2008-02-22 10:28:14 # Node ID 554715e584e6d9a4275fffd9065d9330511eafc4 # Parent bc1ba9124799e213e26edcce7111458b965dad4c Add test case for backout on named branches (issue665) diff --git a/tests/test-backout b/tests/test-backout --- a/tests/test-backout +++ b/tests/test-backout @@ -123,4 +123,37 @@ hg update -C hg backout -d '6 0' --parent 3 4 +cd .. + +echo '# named branches' + +hg init named_branches +cd named_branches + +echo default > default +hg ci -d '0 0' -Am default +hg branch branch1 +echo branch1 > file1 +hg ci -d '1 0' -Am file1 +hg branch branch2 +echo branch2 > file2 +hg ci -d '2 0' -Am file2 +hg backout -d '3 0' -r 1 -m 'backout on branch1' +# XXX maybe backout shouldn't suggest a merge here as it is a different branch? + +echo '% on branch2 with branch1 not merged, so file1 should still exist:' +hg id +hg st -A + +echo '% on branch2 with branch1 merged, so file1 should be gone:' +hg merge +hg ci -d '4 0' -m 'merge backout of branch1' +hg id +hg st -A + +echo '% on branch1, so no file1 and file2:' +hg co -C branch1 +hg id +hg st -A + exit 0 diff --git a/tests/test-backout.out b/tests/test-backout.out --- a/tests/test-backout.out +++ b/tests/test-backout.out @@ -62,3 +62,28 @@ rolling back last transaction 1 files updated, 0 files merged, 0 files removed, 0 files unresolved removing c changeset 5:033590168430 backs out changeset 4:b2f3bb92043e +# named branches +adding default +marked working directory as branch branch1 +adding file1 +marked working directory as branch branch2 +adding file2 +removing file1 +changeset 3:f1c642b1d8e5 backs out changeset 1:bf1602f437f3 +the backout changeset is a new head - do not forget to merge +(use "backout --merge" if you want to auto-merge) +% on branch2 with branch1 not merged, so file1 should still exist: +45bbcd363bf0 (branch2) +C default +C file1 +C file2 +% on branch2 with branch1 merged, so file1 should be gone: +0 files updated, 0 files merged, 1 files removed, 0 files unresolved +(branch merge, don't forget to commit) +21d4dc6f9a41 (branch2) tip +C default +C file2 +% on branch1, so no file1 and file2: +0 files updated, 0 files merged, 1 files removed, 0 files unresolved +f1c642b1d8e5 (branch1) +C default