Mercurial > hg-stable
changeset 6162:554715e584e6
Add test case for backout on named branches (issue665)
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 22 Feb 2008 11:28:14 +0100 |
parents | bc1ba9124799 |
children | 1f733c2f0165 |
files | tests/test-backout tests/test-backout.out |
diffstat | 2 files changed, 58 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-backout Thu Feb 21 08:52:52 2008 +0100 +++ b/tests/test-backout Fri Feb 22 11:28:14 2008 +0100 @@ -123,4 +123,37 @@ 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
--- a/tests/test-backout.out Thu Feb 21 08:52:52 2008 +0100 +++ b/tests/test-backout.out Fri Feb 22 11:28:14 2008 +0100 @@ -62,3 +62,28 @@ 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