Mercurial > hg
comparison tests/test-hook.t @ 50923:c642c03969ff
dynamic-import: use sysstr for importing extension and others
This logic is used by extensions, and python hooks and merge-tools. All this
logic eventually deals with native string (unicode in Python 3). This patch
makes it handle `str` directly instead of relying on some pycompat low lever
layer to do the conversion at the last minutes.
We adjust the Python version filtering of a test as the output seems to be present with Python 3.7 too.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 31 Aug 2023 02:41:33 +0200 |
parents | 7e5be4a7cda7 |
children | dcaa2df1f688 |
comparison
equal
deleted
inserted
replaced
50922:0e6cea0c3113 | 50923:c642c03969ff |
---|---|
989 Traceback (most recent call last): | 989 Traceback (most recent call last): |
990 SyntaxError: * (glob) | 990 SyntaxError: * (glob) |
991 Traceback (most recent call last): | 991 Traceback (most recent call last): |
992 ModuleNotFoundError: No module named 'hgext_syntaxerror' | 992 ModuleNotFoundError: No module named 'hgext_syntaxerror' |
993 Traceback (most recent call last): | 993 Traceback (most recent call last): |
994 raise error.HookLoadError( (py38 !) | 994 raise error.HookLoadError(msg, hint=tracebackhint) (py37 !) |
995 mercurial.error.HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed | 995 mercurial.error.HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed |
996 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed | 996 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed |
997 | 997 |
998 $ echo '[hooks]' > ../a/.hg/hgrc | 998 $ echo '[hooks]' > ../a/.hg/hgrc |
999 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc | 999 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc |
1154 Traceback (most recent call last): | 1154 Traceback (most recent call last): |
1155 ModuleNotFoundError: No module named 'somebogusmodule' | 1155 ModuleNotFoundError: No module named 'somebogusmodule' |
1156 Traceback (most recent call last): | 1156 Traceback (most recent call last): |
1157 ModuleNotFoundError: No module named 'hgext_importfail' | 1157 ModuleNotFoundError: No module named 'hgext_importfail' |
1158 Traceback (most recent call last): | 1158 Traceback (most recent call last): |
1159 raise error.HookLoadError( (py38 !) | 1159 raise error.HookLoadError(msg, hint=tracebackhint) (py37 !) |
1160 mercurial.error.HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed | 1160 mercurial.error.HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed |
1161 abort: precommit.importfail hook is invalid: import of "importfail" failed | 1161 abort: precommit.importfail hook is invalid: import of "importfail" failed |
1162 | 1162 |
1163 Issue1827: Hooks Update & Commit not completely post operation | 1163 Issue1827: Hooks Update & Commit not completely post operation |
1164 | 1164 |