##// END OF EJS Templates
tests: remove sed -i from test-record
Matt Mackall -
r16332:42e95631 default
parent child Browse files
Show More
@@ -47,6 +47,7 b' testpats = ['
47 47 (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"),
48 48 (r'^function', "don't use 'function', use old style"),
49 49 (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"),
50 (r'sed.*-i', "don't use 'sed -i', use a temporary file"),
50 51 (r'echo.*\\n', "don't use 'echo \\n', use printf"),
51 52 (r'echo -n', "don't use 'echo -n', use printf"),
52 53 (r'^diff.*-\w*N', "don't use 'diff -N'"),
@@ -919,7 +919,8 b' Editing patch'
919 919
920 920 $ cat > editor << '__EOF__'
921 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 924 > __EOF__
924 925 $ chmod +x editor
925 926 $ cat > editedfile << '__EOF__'
@@ -980,7 +981,8 b' Removing changes from patch'
980 981 $ echo "This line has been added" >> editedfile
981 982 $ cat > editor << '__EOF__'
982 983 > #!/bin/sh
983 > sed -i -e 's/^[-+]/ /' "$1"
984 > sed -e 's/^[-+]/ /' "$1" > tmp
985 > mv tmp "$1"
984 986 > __EOF__
985 987 $ chmod +x editor
986 988 $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
@@ -1011,11 +1013,13 b' Removing changes from patch'
1011 1013
1012 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 1018 $ echo "This line has been added" >> editedfile
1016 1019 $ cat > editor << '__EOF__'
1017 1020 > #!/bin/sh
1018 > sed -i s/This/That/ "$1"
1021 > sed s/This/That/ "$1" > tmp
1022 > mv tmp "$1"
1019 1023 > __EOF__
1020 1024 $ chmod +x editor
1021 1025 $ HGEDITOR="'`pwd`'"/editor hg record <<EOF
General Comments 0
You need to be logged in to leave comments. Login now