##// END OF EJS Templates
check-code: add a rule against a GNU sed-ism...
Kevin Bullock -
r19080:5e4491c1 stable
parent child Browse files
Show More
@@ -74,6 +74,8 b' testpats = ['
74 (r'/dev/u?random', "don't use entropy, use /dev/zero"),
74 (r'/dev/u?random', "don't use entropy, use /dev/zero"),
75 (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"),
75 (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"),
76 (r'^( *)\t', "don't use tabs to indent"),
76 (r'^( *)\t', "don't use tabs to indent"),
77 (r'sed .*\'/[^/]*/i[^\\][^\n]',
78 "put a backslash-escaped newline after sed 'i' command"),
77 ],
79 ],
78 # warnings
80 # warnings
79 [
81 [
@@ -1039,7 +1039,8 b' Abort early when a merge is in progress'
1039 Editing patch (and ignoring trailing text)
1039 Editing patch (and ignoring trailing text)
1040
1040
1041 $ cat > editor.sh << '__EOF__'
1041 $ cat > editor.sh << '__EOF__'
1042 > sed -e 7d -e '5s/^-/ /' -e '/^# ---/itrailing\nditto' "$1" > tmp
1042 > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
1043 > trailing\nditto' "$1" > tmp
1043 > mv tmp "$1"
1044 > mv tmp "$1"
1044 > __EOF__
1045 > __EOF__
1045 $ cat > editedfile << '__EOF__'
1046 $ cat > editedfile << '__EOF__'
@@ -1204,7 +1205,8 b' Malformed patch - error handling'
1204 random text in random positions is still an error
1205 random text in random positions is still an error
1205
1206
1206 $ cat > editor.sh << '__EOF__'
1207 $ cat > editor.sh << '__EOF__'
1207 > sed -e '/^@/iother' "$1" > tmp
1208 > sed -e '/^@/i\
1209 > other' "$1" > tmp
1208 > mv tmp "$1"
1210 > mv tmp "$1"
1209 > __EOF__
1211 > __EOF__
1210 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
1212 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg record <<EOF
General Comments 0
You need to be logged in to leave comments. Login now