diff tests/test-stabilize-conflict.t @ 581:b66b05065dd0 stable

test-stabilize-conflict.t: sed -i is still not portable
author Patrick Mezard <patrick@mezard.eu>
date Sat, 13 Oct 2012 16:38:23 +0200
parents 4676650f4f9d
children 8e1ca984dd78
line wrap: on
line diff
--- a/tests/test-stabilize-conflict.t	Sat Oct 13 16:31:52 2012 +0200
+++ b/tests/test-stabilize-conflict.t	Sat Oct 13 16:38:23 2012 +0200
@@ -19,6 +19,10 @@
   > EOF
   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
 
+  $ safesed() {
+  >   sed "$1" "$2" > `pwd`/sed.temp
+  >   mv `pwd`/sed.temp "$2"
+  > }
 
 create a simple repo
 
@@ -57,7 +61,7 @@
   $ hg gdown
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   [1] babar count up to ten
-  $ sed -i'' 's/huit/height/' babar
+  $ safesed 's/huit/height/' babar
   $ hg diff
   diff -r 9d5daf8bd956 babar
   --- a/babar	Thu Jan 01 00:00:00 1970 +0000
@@ -103,7 +107,7 @@
   $ hg gdown
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   [4] babar count up to ten
-  $ sed -i'' 's/dix/ten/' babar
+  $ safesed 's/dix/ten/' babar
   $ hg diff
   diff -r 83066dedff55 babar
   --- a/babar	Thu Jan 01 00:00:00 1970 +0000
@@ -156,7 +160,7 @@
 
   $ hg revert -r 5 --all
   reverting babar
-  $ sed -i'' 's/dix/ten/' babar
+  $ safesed 's/dix/ten/' babar
   $ hg resolve --all -m
   $ hg evolve --continue
   grafting revision 5
@@ -182,12 +186,12 @@
 proper behavior with conflict using an external merge tools
 -----------------------------------------------------------
 
-  $ sed -i'' 's/merge=.*/merge=touch/' $HGRCPATH
-  $ sed -i'' 's/touch.gui=.*/touch.gui=false/' $HGRCPATH
+  $ safesed 's/merge=.*/merge=touch/' $HGRCPATH
+  $ safesed 's/touch.gui=.*/touch.gui=false/' $HGRCPATH
   $ hg gdown
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   [7] babar count up to ten
-  $ sed -i'' 's/ten/zehn/' babar
+  $ safesed 's/ten/zehn/' babar
   $ hg diff
   diff -r cc96f75eae0b babar
   --- a/babar	Thu Jan 01 00:00:00 1970 +0000
@@ -200,7 +204,7 @@
   +zehn
   $ hg amend
   1 new unstable changesets
-  $ sed -i'' 's/interactive=.*/interactive=true/' $HGRCPATH
+  $ safesed 's/interactive=.*/interactive=true/' $HGRCPATH
   $ HGMERGE=touch hg evolve <<EOF
   > n
   > EOF