comparison tests/test-hook.t @ 50725:7e5be4a7cda7 stable

tests: use grep -E instead of obsolescent egrep Testing on Fedora 38 failed with: egrep: warning: egrep is obsolescent; using grep -E The warning comes from https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1 . For further anecdotal evidence of the change, see https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep . This reverses the code check that goes back to e7d3b509af8b. grep -E is POSIX, but there is a risk that it doesn't work the same on all platforms - especially older Unix versions. It should however always be possible to put a GNU grep in $PATH before running the tests.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 26 Jun 2023 14:34:58 +0200
parents 63dc24be635d
children c642c03969ff
comparison
equal deleted inserted replaced
50724:a10d823a8e3d 50725:7e5be4a7cda7
973 searching for changes 973 searching for changes
974 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed 974 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
975 (run with --traceback for stack trace) 975 (run with --traceback for stack trace)
976 [255] 976 [255]
977 977
978 $ hg pull ../a --traceback 2>&1 | egrep 'pulling|searching|^exception|Traceback|SyntaxError|ImportError|ModuleNotFoundError|HookLoadError|abort' 978 $ hg pull ../a --traceback 2>&1 | grep -E 'pulling|searching|^exception|Traceback|SyntaxError|ImportError|ModuleNotFoundError|HookLoadError|abort'
979 pulling from ../a 979 pulling from ../a
980 searching for changes 980 searching for changes
981 exception from first failed import attempt: 981 exception from first failed import attempt:
982 Traceback (most recent call last): 982 Traceback (most recent call last):
983 SyntaxError: * (glob) 983 SyntaxError: * (glob)
1140 1140
1141 $ echo '[hooks]' > .hg/hgrc 1141 $ echo '[hooks]' > .hg/hgrc
1142 $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc 1142 $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
1143 1143
1144 $ echo a >> a 1144 $ echo a >> a
1145 $ hg --traceback commit -ma 2>&1 | egrep '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort' 1145 $ hg --traceback commit -ma 2>&1 | grep -E '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort'
1146 exception from first failed import attempt: 1146 exception from first failed import attempt:
1147 Traceback (most recent call last): 1147 Traceback (most recent call last):
1148 ModuleNotFoundError: No module named 'somebogusmodule' 1148 ModuleNotFoundError: No module named 'somebogusmodule'
1149 exception from second failed import attempt: 1149 exception from second failed import attempt:
1150 Traceback (most recent call last): 1150 Traceback (most recent call last):