Show More
@@ -47,6 +47,7 b' testpats = [' | |||||
47 | (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"), |
|
47 | (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"), | |
48 | (r'^function', "don't use 'function', use old style"), |
|
48 | (r'^function', "don't use 'function', use old style"), | |
49 | (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"), |
|
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 | (r'echo.*\\n', "don't use 'echo \\n', use printf"), |
|
51 | (r'echo.*\\n', "don't use 'echo \\n', use printf"), | |
51 | (r'echo -n', "don't use 'echo -n', use printf"), |
|
52 | (r'echo -n', "don't use 'echo -n', use printf"), | |
52 | (r'^diff.*-\w*N', "don't use 'diff -N'"), |
|
53 | (r'^diff.*-\w*N', "don't use 'diff -N'"), |
@@ -919,7 +919,8 b' Editing patch' | |||||
919 |
|
919 | |||
920 | $ cat > editor << '__EOF__' |
|
920 | $ cat > editor << '__EOF__' | |
921 | > #!/bin/sh |
|
921 | > #!/bin/sh | |
922 |
> sed |
|
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__' | |
@@ -980,7 +981,8 b' Removing changes from patch' | |||||
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 |
|
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 | |
@@ -1011,11 +1013,13 b' Removing changes from patch' | |||||
1011 |
|
1013 | |||
1012 | Invalid patch |
|
1014 | Invalid patch | |
1013 |
|
1015 | |||
1014 |
$ sed |
|
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 |
|
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 |
General Comments 0
You need to be logged in to leave comments.
Login now