test-merge1: avoid a shell script
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Tue, 27 Mar 2007 01:41:17 -0300
changeset 4294 ccfe423d3d0a
parent 4293 b0140ead7f70
child 4295 a74586023196
test-merge1: avoid a shell script
tests/test-merge1
--- a/tests/test-merge1	Tue Mar 27 01:41:16 2007 -0300
+++ b/tests/test-merge1	Tue Mar 27 01:41:17 2007 -0300
@@ -1,10 +1,10 @@
 #!/bin/sh
 
-cat <<'EOF' > merge
-#!/bin/sh
-echo merging for `basename $1`
+cat <<EOF > merge
+import sys, os
+print "merging for", os.path.basename(sys.argv[1])
 EOF
-chmod +x merge
+HGMERGE="python ../merge"; export HGMERGE
 
 mkdir t
 cd t
@@ -22,7 +22,7 @@
 hg commit -m "commit #2" -d "1000000 0"
 echo This is file b1 > b
 echo %% no merges expected
-env HGMERGE=../merge hg merge 1
+hg merge 1
 hg diff --nodates
 hg status
 cd ..; rm -r t
@@ -43,9 +43,9 @@
 hg commit -m "commit #2" -d "1000000 0"
 echo This is file b2 > b
 echo %% merge should fail
-env HGMERGE=../merge hg merge 1
+hg merge 1
 echo %% merge of b expected
-env HGMERGE=../merge hg merge -f 1
+hg merge -f 1
 hg diff --nodates
 hg status
 cd ..; rm -r t
@@ -72,9 +72,9 @@
 
 echo This is file b22 > b
 echo %% merge fails
-env HGMERGE=../merge hg merge 2
+hg merge 2
 echo %% merge expected!
-env HGMERGE=../merge hg merge -f 2
+hg merge -f 2
 hg diff --nodates
 hg status
 cd ..; rm -r t
@@ -96,8 +96,8 @@
 hg commit -m "commit #3" -d "1000000 0"
 echo This is file b33 > b
 echo %% merge of b should fail
-env HGMERGE=../merge hg merge 2
+hg merge 2
 echo %% merge of b expected
-env HGMERGE=../merge hg merge -f 2
+hg merge -f 2
 hg diff --nodates
 hg status