Commits

Patrick Mézard committed b66b050

test-stabilize-conflict.t: sed -i is still not portable

Comments (0)

Files changed (1)

tests/test-stabilize-conflict.t

   > 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
 
   $ 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
   $ 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
 
   $ 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
 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
   +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