Added tests for bug with three-way-merging of old tip, tip and cwd.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert Sat Jul 23 17:14:05 2005 +0100
@@ -0,0 +1,45 @@
+#!/bin/sh -x
+
+mkdir t
+cd t
+hg init
+echo "added file1" > file1
+echo "added file2" > file2
+hg add file1 file2
+hg commit -m "added file1 and file2" -d "0 0" -u user
+echo "changed file1" >> file1
+hg commit -m "changed file1" -d "0 0" -u user
+hg -q log
+hg id
+hg update -C 0
+hg id
+echo "changed file1" >> file1
+hg id
+hg revert
+hg diff
+hg status
+hg id
+hg update
+hg diff
+hg status
+hg id
+hg update -C 0
+echo "changed file1" >> file1
+HGMERGE=merge hg update
+hg diff
+hg status
+hg id
+hg revert
+hg diff
+hg status
+hg id
+hg revert -r tip
+hg diff
+hg status
+hg id
+hg update -C
+hg diff
+hg status
+hg id
+cd ..; /bin/rm -rf t
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert.out Sat Jul 23 17:14:05 2005 +0100
@@ -0,0 +1,56 @@
++ mkdir t
++ cd t
++ hg init
++ echo 'added file1'
++ echo 'added file2'
++ hg add file1 file2
++ hg commit -m 'added file1 and file2' -d '0 0' -u user
++ echo 'changed file1'
++ hg commit -m 'changed file1' -d '0 0' -u user
++ hg -q log
+1:3aa14bbc23d90e3f8b5b639b4a43d76509bae76c
+0:8633637036c18f021d771208e16ae3508ab81d28
++ hg id
+3aa14bbc23d9 tip
++ hg update -C 0
++ hg id
+8633637036c1
++ echo 'changed file1'
++ hg id
+8633637036c1+
++ hg revert
++ hg diff
++ hg status
++ hg id
+8633637036c1
++ hg update
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg update -C 0
++ echo 'changed file1'
++ HGMERGE=merge
++ hg update
+merging file1
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg revert
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg revert -r tip
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg update -C
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ cd ..
++ /bin/rm -rf t
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert2 Sat Jul 23 17:14:05 2005 +0100
@@ -0,0 +1,45 @@
+#!/bin/sh -x
+
+mkdir t
+cd t
+hg init
+echo "added file1" > file1
+echo "added file2" > file2
+hg add file1 file2
+hg commit -m "added file1 and file2" -d "0 0" -u user
+echo "changed file1" >> file1
+hg commit -m "changed file1" -d "0 0" -u user
+hg -q log
+hg id
+hg update -C 0
+hg id
+echo "changed file1" >> file1
+hg id
+hg revert
+hg diff
+hg status
+hg id
+hg update
+hg diff
+hg status
+hg id
+hg update -C 0
+echo "changed file1 different" >> file1
+HGMERGE=merge hg update
+hg diff | sed -e "s/\(\(---\|+++\).*\)\t.*/\1/" -e "s/\(<<<<<<<\|>>>>>>>\) .*/\1/"
+hg status
+hg id
+hg revert
+hg diff
+hg status
+hg id
+hg revert -r tip
+hg diff
+hg status
+hg id
+hg update -C
+hg diff
+hg status
+hg id
+cd ..; /bin/rm -rf t
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-merge-revert2.out Sat Jul 23 17:14:05 2005 +0100
@@ -0,0 +1,70 @@
++ mkdir t
++ cd t
++ hg init
++ echo 'added file1'
++ echo 'added file2'
++ hg add file1 file2
++ hg commit -m 'added file1 and file2' -d '0 0' -u user
++ echo 'changed file1'
++ hg commit -m 'changed file1' -d '0 0' -u user
++ hg -q log
+1:3aa14bbc23d90e3f8b5b639b4a43d76509bae76c
+0:8633637036c18f021d771208e16ae3508ab81d28
++ hg id
+3aa14bbc23d9 tip
++ hg update -C 0
++ hg id
+8633637036c1
++ echo 'changed file1'
++ hg id
+8633637036c1+
++ hg revert
++ hg diff
++ hg status
++ hg id
+8633637036c1
++ hg update
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg update -C 0
++ echo 'changed file1 different'
++ HGMERGE=merge
++ hg update
+merge: warning: conflicts during merge
+merging file1
+merging file1 failed!
++ hg diff
++ sed -e 's/\(\(---\|+++\).*\)\t.*/\1/' -e 's/\(<<<<<<<\|>>>>>>>\) .*/\1/'
+diff -r 3aa14bbc23d9 file1
+--- a/file1
++++ b/file1
+@@ -1,2 +1,6 @@
+ added file1
++<<<<<<<
++changed file1 different
++=======
+ changed file1
++>>>>>>>
++ hg status
+M file1
++ hg id
+3aa14bbc23d9+ tip
++ hg revert
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg revert -r tip
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ hg update -C
++ hg diff
++ hg status
++ hg id
+3aa14bbc23d9 tip
++ cd ..
++ /bin/rm -rf t