--- a/tests/test-win32text Thu Apr 23 15:40:10 2009 -0500
+++ b/tests/test-win32text Fri Apr 24 00:06:01 2009 -0700
@@ -1,5 +1,8 @@
#!/bin/sh
+hg init t
+cd t
+
cat > unix2dos.py <<EOF
import sys
@@ -14,7 +17,6 @@
print(sys.stdin.read().replace('\n', '<LF>').replace('\r', '<CR>').replace('\0', '<NUL>'))
EOF
-hg init
echo '[hooks]' >> .hg/hgrc
echo 'pretxncommit.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
echo 'pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
@@ -23,14 +25,41 @@
echo hello > f
hg add f
+echo commit should succeed
hg ci -m 1 -d'0 0'
echo
+hg clone . ../zoz
+cp .hg/hgrc ../zoz/.hg
+
python unix2dos.py f
+echo commit should fail
+hg ci -m 2.1 -d'0 0'
+echo
+
+mv .hg/hgrc .hg/hgrc.bak
+echo commits should succeed
hg ci -m 2 -d'0 0'
-hg revert -a
+hg cp f g
+hg ci -m 2.2 -d'0 0'
echo
+echo push should fail
+hg push ../zoz
+echo
+
+mv .hg/hgrc.bak .hg/hgrc
+echo hello > f
+hg rm g
+echo commit should succeed
+hg ci -m 2.3 -d'0 0'
+echo
+
+echo push should succeed
+hg push ../zoz
+echo
+
+echo and now for something completely different
mkdir d
echo hello > d/f2
python unix2dos.py d/f2