Mercurial > hg
comparison tests/test-hook.t @ 43292:3f1b4d1a90c3
tests: use non-reverse grep in traceback in test-hook.t
This will prepare for updating test output for Python 3.
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Fri, 18 Oct 2019 16:38:37 +0200 |
parents | a973a75e92bf |
children | d0f89e8c615a |
comparison
equal
deleted
inserted
replaced
43291:a973a75e92bf | 43292:3f1b4d1a90c3 |
---|---|
966 searching for changes | 966 searching for changes |
967 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed | 967 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed |
968 (run with --traceback for stack trace) | 968 (run with --traceback for stack trace) |
969 [255] | 969 [255] |
970 | 970 |
971 The second egrep is to filter out lines like ' ^', which are slightly | 971 $ hg pull ../a --traceback 2>&1 | egrep 'pulling|searching|^exception|Traceback|SyntaxError|ImportError|ModuleNotFoundError|HookLoadError|abort' |
972 different between Python 2.6 and Python 2.7. | |
973 $ hg pull ../a --traceback 2>&1 | egrep -v '^( +File| [_a-zA-Z*(])' | egrep -v '^( )+(\^)?$' | |
974 pulling from ../a | 972 pulling from ../a |
975 searching for changes | 973 searching for changes |
976 exception from first failed import attempt: | 974 exception from first failed import attempt: |
977 Traceback (most recent call last): | 975 Traceback (most recent call last): |
978 SyntaxError: * (glob) | 976 SyntaxError: * (glob) |
1130 | 1128 |
1131 $ echo '[hooks]' > .hg/hgrc | 1129 $ echo '[hooks]' > .hg/hgrc |
1132 $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc | 1130 $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc |
1133 | 1131 |
1134 $ echo a >> a | 1132 $ echo a >> a |
1135 $ hg --traceback commit -ma 2>&1 | egrep -v '^( +File| [a-zA-Z(])' | 1133 $ hg --traceback commit -ma 2>&1 | egrep '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort' |
1136 exception from first failed import attempt: | 1134 exception from first failed import attempt: |
1137 Traceback (most recent call last): | 1135 Traceback (most recent call last): |
1138 ImportError: No module named somebogusmodule | 1136 ImportError: No module named somebogusmodule |
1139 exception from second failed import attempt: | 1137 exception from second failed import attempt: |
1140 Traceback (most recent call last): | 1138 Traceback (most recent call last): |