comparison tests/test-record.t @ 16332:42e95631887d

tests: remove sed -i from test-record
author Matt Mackall <mpm@selenic.com>
date Sun, 01 Apr 2012 13:59:11 -0500
parents d388c3fc8319
children 118eb4575ea2
comparison
equal deleted inserted replaced
16330:a5a3af000e0d 16332:42e95631887d
917 917
918 Editing patch 918 Editing patch
919 919
920 $ cat > editor << '__EOF__' 920 $ cat > editor << '__EOF__'
921 > #!/bin/sh 921 > #!/bin/sh
922 > sed -i.bak -e 7d -e '5s/^-/ /' "$1" 922 > sed -e 7d -e '5s/^-/ /' "$1" > tmp
923 > mv tmp "$1"
923 > __EOF__ 924 > __EOF__
924 $ chmod +x editor 925 $ chmod +x editor
925 $ cat > editedfile << '__EOF__' 926 $ cat > editedfile << '__EOF__'
926 > This is the first line 927 > This is the first line
927 > This is the second line 928 > This is the second line
978 979
979 $ sed -i -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile 980 $ sed -i -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile
980 $ echo "This line has been added" >> editedfile 981 $ echo "This line has been added" >> editedfile
981 $ cat > editor << '__EOF__' 982 $ cat > editor << '__EOF__'
982 > #!/bin/sh 983 > #!/bin/sh
983 > sed -i -e 's/^[-+]/ /' "$1" 984 > sed -e 's/^[-+]/ /' "$1" > tmp
985 > mv tmp "$1"
984 > __EOF__ 986 > __EOF__
985 $ chmod +x editor 987 $ chmod +x editor
986 $ HGEDITOR="'`pwd`'"/editor hg record <<EOF 988 $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
987 > y 989 > y
988 > e 990 > e
1009 This is the third line 1011 This is the third line
1010 $ hg revert editedfile 1012 $ hg revert editedfile
1011 1013
1012 Invalid patch 1014 Invalid patch
1013 1015
1014 $ sed -i -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile 1016 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1017 $ mv tmp editedfile
1015 $ echo "This line has been added" >> editedfile 1018 $ echo "This line has been added" >> editedfile
1016 $ cat > editor << '__EOF__' 1019 $ cat > editor << '__EOF__'
1017 > #!/bin/sh 1020 > #!/bin/sh
1018 > sed -i s/This/That/ "$1" 1021 > sed s/This/That/ "$1" > tmp
1022 > mv tmp "$1"
1019 > __EOF__ 1023 > __EOF__
1020 $ chmod +x editor 1024 $ chmod +x editor
1021 $ HGEDITOR="'`pwd`'"/editor hg record <<EOF 1025 $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
1022 > y 1026 > y
1023 > e 1027 > e